std::function<void(OpSchema&)> AveragePoolDocGenerator(
const char* dim,
bool relu_fused = false) {
- auto suffix = relu_fused ? " Output will go through rectified linear "
- "function, where y = max(0, x)."
- : "";
return [=](OpSchema& schema) {
string doc = "AveragePool{dim} {pool_doc}";
c10::ReplaceAll(doc, "{dim}", dim);
c10::ReplaceAll(doc, "{pool_doc}", kAveragePoolDoc_int8);
schema.SetDoc(doc);
- string output_doc =
- "Output data tensor from average pooling across the input "
- "tensor. Dimensions will vary based on various kernel, stride, and pad "
- "sizes.{suffix}";
- c10::ReplaceAll(output_doc, "{suffix}", suffix);
schema.Input(
0,
"X",
"size, C is the number of channels, and H and W are the height and the "
"width of the data. The corresponding permutation of dimensions is "
"used in the latter case.");
- schema.Output(0, "Y", output_doc.c_str());
+ schema.Output(0, "Y", relu_fused ?
+ "Output data tensor from average pooling across the input "
+ "tensor. Dimensions will vary based on various kernel, stride, and pad "
+ "sizes. Output will go through rectified linear "
+ "function, where y = max(0, x)." :
+ "Output data tensor from average pooling across the input "
+ "tensor. Dimensions will vary based on various kernel, stride, and pad "
+ "sizes.");
};
}
std::function<void(OpSchema&)> ConvDocGenerator(
const char* dim,
bool relu_fused = false) {
- auto suffix = relu_fused ? " Output will go through rectified linear "
- "function, where y = max(0, x)."
- : "";
return [=](OpSchema& schema) {
string doc = R"DOC(
The convolution operator consumes an input vector, a {dim}filter blob
c10::ReplaceAll(doc, "{dim}", dim);
c10::ReplaceAll(doc, "{conv_doc}", kConvDoc_int8);
schema.SetDoc(doc);
- string output_doc =
- "Output data blob that contains the result of the "
- "convolution. The output dimensions are functions of the kernel size, "
- "stride size, and pad lengths.{suffix}";
- c10::ReplaceAll(output_doc, "{suffix}", suffix);
schema.Input(
0,
"X",
"bias",
"The 1D bias blob that is added through the "
"convolution; has size (M).");
- schema.Output(0, "Y", output_doc.c_str());
+ schema.Output(0, "Y", relu_fused ?
+ "Output data blob that contains the result of the "
+ "convolution. The output dimensions are functions of the kernel size, "
+ "stride size, and pad lengths. Output will go through rectified linear "
+ "function, where y = max(0, x)." :
+ "Output data blob that contains the result of the "
+ "convolution. The output dimensions are functions of the kernel size, "
+ "stride size, and pad lengths.");
};
}
std::function<void(OpSchema&)> MaxPoolDocGenerator(
const char* dim,
bool relu_fused = false) {
- auto suffix = relu_fused ? " Output will go through rectified linear "
- "function, where y = max(0, x)."
- : "";
return [=](OpSchema& schema) {
string doc = "MaxPool{dim} {pool_doc}";
c10::ReplaceAll(doc, "{dim}", dim);
c10::ReplaceAll(doc, "{pool_doc}", kMaxPoolDoc_int8);
- string output_doc =
- "Output data tensor from max pooling across the input "
- "tensor. Dimensions will vary based on various kernel, stride, and pad "
- "sizes.{suffix}";
- c10::ReplaceAll(output_doc, "{suffix}", suffix);
schema.SetDoc(doc);
schema.Input(
0,
"size, C is the number of channels, and H and W are the height and the "
"width of the data. The corresponding permutation of dimensions is "
"used in the latter case.");
- schema.Output(0, "Y", output_doc.c_str());
+ schema.Output(0, "Y", relu_fused ?
+ "Output data tensor from max pooling across the input "
+ "tensor. Dimensions will vary based on various kernel, stride, and pad "
+ "sizes. Output will go through rectified linear"
+ "function, where y = max(0, x)." :
+ "Output data tensor from max pooling across the input "
+ "tensor. Dimensions will vary based on various kernel, stride, and pad "
+ "sizes. Output will go through rectified linear");
};
}