1 #include "caffe2/operators/quantized/int8_add_op.h" 5 #include "caffe2/operators/utility_ops.h" 9 REGISTER_CPU_OPERATOR(Int8Add, int8::Int8AddOp<int8::Activation::NONE>);
10 REGISTER_CPU_OPERATOR(Int8AddRelu, int8::Int8AddOp<int8::Activation::RELU>);
12 REGISTER_CPU_OPERATOR(Int8Sum, int8::Int8AddOp<int8::Activation::NONE>);
13 REGISTER_CPU_OPERATOR(Int8SumRelu, int8::Int8AddOp<int8::Activation::RELU>);
15 OPERATOR_SCHEMA(Int8Add)
18 .AllowInplace({{0, 0}, {1, 0}})
19 .Arg(
"Y_scale",
"Output tensor quantization scale")
20 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
22 Performs element-wise binary Add (with no broadcast support). 27 "First operand, should share the type with the second operand.")
28 .Input(1,
"B",
"Second operand. It should be of the same size as A.")
29 .Output(0,
"C",
"Result, has same dimensions and type as A");
31 OPERATOR_SCHEMA(Int8AddRelu)
34 .AllowInplace({{0, 0}, {1, 0}})
35 .Arg(
"Y_scale",
"Output tensor quantization scale")
36 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
38 Performs element-wise binary Add (with no broadcast support). " 39 "Output will go through rectified linear " 40 "function, where y = max(0, x). 45 "First operand, should share the type with the second operand.")
46 .Input(1,
"B",
"Second operand. It should be of the same size as A.")
47 .Output(0,
"C",
"Result, has same dimensions and type as A");
56 OPERATOR_SCHEMA(Int8Sum)
57 .NumInputs(1, std::numeric_limits<int>::max())
59 .AllowInplace({{0, 0}, {1, 0}})
60 .CostInferenceFunction(CostInferenceForSum)
61 .IdenticalTypeAndShapeOfInput(0)
62 .Arg(
"Y_scale",
"Output tensor quantization scale")
63 .Arg(
"Y_zero_point",
"Output tensor quantization offset");
65 OPERATOR_SCHEMA(Int8SumRelu)
66 .NumInputs(1, std::numeric_limits<int>::max())
68 .AllowInplace({{0, 0}, {1, 0}})
69 .CostInferenceFunction(CostInferenceForSum)
70 .IdenticalTypeAndShapeOfInput(0)
71 .Arg(
"Y_scale",
"Output tensor quantization scale")
72 .Arg(
"Y_zero_point",
"Output tensor quantization offset");
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...