1 #ifndef CAFFE2_OPERATORS_INT8_DEQUANTIZE_OP_H_ 2 #define CAFFE2_OPERATORS_INT8_DEQUANTIZE_OP_H_ 4 #include "caffe2/core/context.h" 5 #include "caffe2/core/operator.h" 6 #include "caffe2/core/tensor_int8.h" 7 #include "caffe2/operators/quantized/int8_utils.h" 20 const int32_t X_offset) {
21 for (
auto i = 0; i < N; ++i) {
22 out[i] = (
static_cast<int32_t
>(in[i]) - X_offset) * X_scale;
32 bool RunOnDevice()
override {
33 const auto& X = Inputs()[0]->template Get<Int8TensorCPU>();
35 auto* Y = Output(0, X.t.sizes(), at::dtype<float>());
36 int32_t X_offset = X.zero_point;
37 auto X_scale = X.scale;
40 Y->mutable_data<
float>(),
52 #endif // CAFFE2_OPERATORS_INT8_DEQUANTIZE_OP_H_ A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...