Caffe2 - C++ API
A deep learning, cross platform ML framework
1 #include "caffe2/operators/conv_transpose_op.h"
2 #include "caffe2/operators/conv_transpose_op_impl.h"
4 namespace caffe2 {
6 REGISTER_CPU_OPERATOR(ConvTranspose, ConvTransposeOp<float, CPUContext>);
8 OPERATOR_SCHEMA(ConvTranspose)
9  .NumInputs(2, 3)
10  .NumOutputs(1)
11  .SetDoc(R"DOC(
12 The transposed convolution consumes an input vector, the filter blob, and
13 the bias blob, and computes the output. Note that other parameters, such as
14 the stride and kernel size, or the pads' sizes in each direction are not
15 necessary for input because they are provided by the
16 ConvTransposeUnpoolOpBase operator. Various dimension checks are done
17 implicitly, and the sizes are specified in the Input docs for this operator.
18 As is expected, the filter is deconvolved with a subset of the
19 image and the bias is added; this is done throughout the image data and the
20 output is computed. As a side note on the implementation layout:
21 conv_transpose_op_impl.h is the templated implementation of the
22 conv_transpose_op.h file, which is why they are separate files.
23  )DOC")
24  .Input(
25  0,
26  "X",
27  "Input data blob from previous layer; has size "
28  "(N x C x H x W), where N is the batch size, C is the number of channels, and"
29  " H and W are the height and width. Note that this is for the NCHW usage. On "
30  "the other hand, the NHWC Op has a different set of dimension constraints.")
31  .Input(
32  1,
33  "filter",
34  "The filter blob that will be used in the transposed "
35  "convolution; has size (M x C x kH x kW), where C is the number of channels,"
36  " and kH and kW are the height and width of the kernel.")
37  .Input(
38  2,
39  "bias",
40  "The 1D bias blob that is added through the convolution;"
41  "has size (C). Optional, if not passed, will treat it as all 0.")
42  .Output(
43  0,
44  "Y",
45  "Output data blob that contains the result of the "
46  "transposed convolution. The output dimensions are functions of the kernel"
47  " size, stride size, and pad lengths.")
48  .InheritOnnxSchema("ConvTranspose");
50 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...