Caffe2 - C++ API
A deep learning, cross platform ML framework
int8_flatten_op.cc
1 #include "caffe2/operators/quantized/int8_flatten_op.h"
2 
3 #include "caffe2/operators/flatten_op.h"
4 
5 namespace caffe2 {
6 
7 REGISTER_CPU_OPERATOR(Int8Flatten, int8::Int8FlattenOp);
8 
9 OPERATOR_SCHEMA(Int8Flatten)
10  .NumInputs(1)
11  .NumOutputs(1)
12  .TensorInferenceFunction(TensorInferenceForFlatten)
13  .SetDoc(R"DOC(
14 Flattens the input tensor into a 2D matrix. If input tensor has shape
15 (d_0, d_1, ... d_n) then the output will have shape
16 (d_0 X d_1 ... d_(axis-1), d_axis X d_(axis+1) ... X dn)
17 )DOC")
18  .Input(0, "input", "A Int8 tensor of rank >= axis.")
19  .Output(
20  0,
21  "output",
22  "A 2D Int8 tensor with the contents of the input tensor, "
23  "with input dimensions up to axis flattened to the outer dimension "
24  "of the output and remaining input dimensions flattened into the inner "
25  "dimension of the output.")
26  .Arg("Y_scale", "Output tensor quantization scale")
27  .Arg("Y_zero_point", "Output tensor quantization offset")
28  .Arg(
29  "axis",
30  "(Default to 1) Indicate up to which input dimensions "
31  "(exclusive) should be flattened to the outer dimension of the output");
32 
33 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13