1 #include "caffe2/operators/quantized/int8_relu_op.h" 7 OpSchema::Cost CostInferenceForRelu(
8 const OperatorDef& def,
9 const vector<TensorShape>& in) {
10 struct OpSchema::Cost cost = PointwiseCostInference<0>(def, in);
11 cost.params_bytes = 0;
17 REGISTER_CPU_OPERATOR(Int8Relu, int8::Int8ReluOp);
20 OPERATOR_SCHEMA(Int8Relu)
23 .Arg(
"Y_scale",
"Output tensor quantization scale")
24 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
25 .AllowInplace({{0, 0}})
26 .CostInferenceFunction(CostInferenceForRelu)
27 .IdenticalTypeAndShape()
29 Relu takes one input data (Tensor<T>) and produces one output data 30 (Tensor<T>) where the rectified linear function, y = max(0, x), is applied to 31 the tensor elementwise. 33 .Input(0, "X",
"1D input tensor")
34 .Output(0,
"Y",
"1D input tensor")
35 .InheritOnnxSchema(
"Relu");
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...