1 #include "caffe2/quantization/server/elementwise_dnnlowp_op.h" 2 #include "caffe2/quantization/server/tanh.h" 11 explicit TanhFunctor() : tanh_() {}
13 inline void operator()(
const int n,
const T* x,
T* y) {
14 for (
int i = 0; i < n; ++i) {
15 y[i] = tanh_.Compute(x[i]);
19 TensorQuantizationParams GetOutputQuantizationParams()
const {
20 return tanh_.GetOutputQuantizationParams();
27 REGISTER_CPU_OPERATOR_WITH_ENGINE(
30 UnaryElementwiseWithArgsDNNLowPOp<std::uint8_t, TanhFunctor<std::uint8_t>>);
32 REGISTER_CPU_OPERATOR_WITH_ENGINE(
35 UnaryElementwiseWithArgsDNNLowPOp<std::uint8_t, TanhFunctor<std::uint8_t>>);
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
We use the 3-region approach described in "Efficient VLSI Implementation of Neural Networks with Hype...