1 #include "caffe2/operators/quantized/int8_fc_op.h" 5 #include "caffe2/operators/fc_inference.h" 9 REGISTER_CPU_OPERATOR(Int8FC, int8::Int8FCOp);
12 OPERATOR_SCHEMA(Int8FC)
15 .TensorInferenceFunction(std::bind(FCShapeInference, _1, _2,
false))
16 .CostInferenceFunction(std::bind(CostInferenceForFC, _1, _2,
false))
18 Computes the result of passing an input vector X into a fully 19 connected layer with 2D weight matrix W and 1D bias vector b. That is, 20 the layer computes Y = X * W^T + b, where X has size (M x K), 21 W has size (N x K), b has size (N), and Y has size (M x N), 22 where M is often the batch size. 25 NOTE: X does not need to explicitly be a 2D vector; rather, it will be 26 coerced into one. For an arbitrary n-dimensional tensor 27 X \in [a_0, a_1 * ... * a_{n-1}]. Only this case is supported! 28 Lastly, even though b is a 1D vector of size N, it is copied/resized to 29 be size (M x N) implicitly and added to each vector in the batch. 30 Each of these dimensions must be matched correctly, or else the operator 33 .Arg("Y_scale",
"Output tensor quantization scale")
34 .Arg(
"Y_zero_point",
"Output tensor quantization offset")
38 "input tensor that's coerced into a 2D matrix of size (MxK) " 43 "A tensor that is coerced into a 2D blob of size (KxN) " 44 "containing fully connected weight matrix")
45 .Input(2,
"b",
"1D blob containing bias vector")
46 .Output(0,
"Y",
"2D output tensor");
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...