|
|
@ -248,6 +248,21 @@ void selu(const Stream& stream, Span<T> output, View<T> input, T alpha, T gamma) |
|
|
|
generic_op<T, SeluFunctor<T>>(stream, output, input, {alpha, gamma}); |
|
|
|
generic_op<T, SeluFunctor<T>>(stream, output, input, {alpha, gamma}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <class T> |
|
|
|
|
|
|
|
void sign(const Stream& stream, Span<T> output, View<T> input) { |
|
|
|
|
|
|
|
generic_op<T, SignFunctor<T>>(stream, output, input); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <class T> |
|
|
|
|
|
|
|
void shrink(const Stream& stream, Span<T> output, View<T> input, T bias, T lambd) { |
|
|
|
|
|
|
|
generic_op<T, ShrinkFunctor<T>>(stream, output, input, {bias, lambd}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template <class T> |
|
|
|
|
|
|
|
void reciprocal(const Stream& stream, Span<T> output, View<T> input) { |
|
|
|
|
|
|
|
generic_op<T, SignFunctor<T>>(stream, output, input); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
template <class T> |
|
|
|
template <class T> |
|
|
|
void thresholdedrelu(const Stream& stream, Span<T> output, View<T> input, T alpha) { |
|
|
|
void thresholdedrelu(const Stream& stream, Span<T> output, View<T> input, T alpha) { |
|
|
|
generic_op<T, ThresholdedReluFunctor<T>>(stream, output, input, {alpha}); |
|
|
|
generic_op<T, ThresholdedReluFunctor<T>>(stream, output, input, {alpha}); |
|
|
@ -312,6 +327,9 @@ template void selu<__half>(const Stream&, Span<__half>, View<__half>, __half, __ |
|
|
|
template void thresholdedrelu<__half>(const Stream&, Span<__half>, View<__half>, __half); |
|
|
|
template void thresholdedrelu<__half>(const Stream&, Span<__half>, View<__half>, __half); |
|
|
|
template void power<__half>(const Stream&, Span<__half>, View<__half>, __half, __half, __half); |
|
|
|
template void power<__half>(const Stream&, Span<__half>, View<__half>, __half, __half, __half); |
|
|
|
template void exp<__half>(const Stream&, Span<__half>, View<__half>, __half, __half); |
|
|
|
template void exp<__half>(const Stream&, Span<__half>, View<__half>, __half, __half); |
|
|
|
|
|
|
|
template void sign<__half>(const Stream&, Span<__half>, View<__half>); |
|
|
|
|
|
|
|
template void shrink<__half>(const Stream&, Span<__half>, View<__half>, __half, __half); |
|
|
|
|
|
|
|
template void reciprocal<__half>(const Stream&, Span<__half>, View<__half>); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -351,6 +369,9 @@ template void selu<float>(const Stream&, Span<float>, View<float>, float, float) |
|
|
|
template void thresholdedrelu<float>(const Stream&, Span<float>, View<float>, float); |
|
|
|
template void thresholdedrelu<float>(const Stream&, Span<float>, View<float>, float); |
|
|
|
template void power<float>(const Stream&, Span<float>, View<float>, float, float, float); |
|
|
|
template void power<float>(const Stream&, Span<float>, View<float>, float, float, float); |
|
|
|
template void exp<float>(const Stream&, Span<float>, View<float>, float, float); |
|
|
|
template void exp<float>(const Stream&, Span<float>, View<float>, float, float); |
|
|
|
|
|
|
|
template void sign<float>(const Stream&, Span<float>, View<float>); |
|
|
|
|
|
|
|
template void shrink<float>(const Stream&, Span<float>, View<float>, float, float); |
|
|
|
|
|
|
|
template void reciprocal<float>(const Stream&, Span<float>, View<float>); |
|
|
|
|
|
|
|
|
|
|
|
template <class T, std::size_t N> static |
|
|
|
template <class T, std::size_t N> static |
|
|
|
void launch_vectorized_axiswise_relu(const Stream& stream, Span<T> output, View<T> input, std::size_t inner_size, View<T> slope) { |
|
|
|
void launch_vectorized_axiswise_relu(const Stream& stream, Span<T> output, View<T> input, std::size_t inner_size, View<T> slope) { |
|
|
|