1 #include "caffe2/operators/quantized/int8_average_pool_op.h" 7 int8::Int8AveragePoolOp<int8::Activation::NONE>);
10 int8::Int8AveragePoolOp<int8::Activation::RELU>);
12 const char kAveragePoolDoc_int8[] = R
"DOC( 13 consumes an input blob X and applies average pooling across the 14 the blob according to kernel sizes, stride sizes, and pad lengths defined by the 15 ConvPoolOpBase operator. Average pooling consisting of averaging all values of a 16 subset of the input tensor according to the kernel size and downsampling the 17 data into the output blob Y for further processing. 20 std::function<void(OpSchema&)> AveragePoolDocGenerator( 22 bool relu_fused =
false) {
23 return [=](OpSchema& schema) {
24 string doc =
"AveragePool{dim} {pool_doc}";
25 c10::ReplaceAll(doc,
"{dim}", dim);
26 c10::ReplaceAll(doc,
"{pool_doc}", kAveragePoolDoc_int8);
31 "Input data tensor from the previous operator; dimensions depend on " 32 "whether the NCHW or NHWC operators are being used. For example, in " 33 "the former, the input has size (N x C x H x W), where N is the batch " 34 "size, C is the number of channels, and H and W are the height and the " 35 "width of the data. The corresponding permutation of dimensions is " 36 "used in the latter case.");
37 schema.Output(0,
"Y", relu_fused ?
38 "Output data tensor from average pooling across the input " 39 "tensor. Dimensions will vary based on various kernel, stride, and pad " 40 "sizes. Output will go through rectified linear " 41 "function, where y = max(0, x)." :
42 "Output data tensor from average pooling across the input " 43 "tensor. Dimensions will vary based on various kernel, stride, and pad " 48 OPERATOR_SCHEMA(Int8AveragePool)
51 .Arg(
"Y_scale",
"Output tensor quantization scale")
52 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
53 .TensorInferenceFunction(ConvPoolOpBase<CPUContext>::TensorInferenceForPool)
54 .FillUsing(AveragePoolDocGenerator(
""));
56 OPERATOR_SCHEMA(Int8AveragePoolRelu)
59 .Arg(
"Y_scale",
"Output tensor quantization scale")
60 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
61 .TensorInferenceFunction(ConvPoolOpBase<CPUContext>::TensorInferenceForPool)
62 .FillUsing(AveragePoolDocGenerator(
"",
true));
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...