@@ -39,7 +39,7 @@ void ConvTransposeOp::InferShape(framework::InferShapeContext* ctx) const {
39
39
" ConvTransposeOp input dimension and strides dimension should "
40
40
" be consistent." );
41
41
PADDLE_ENFORCE_EQ (paddings.size (), strides.size (),
42
- " ConvTransposeOp paddings dimension and Conv strides "
42
+ " ConvTransposeOp paddings dimension and strides "
43
43
" dimension should be the same." );
44
44
PADDLE_ENFORCE_EQ (in_dims[1 ], filter_dims[0 ],
45
45
" In ConvTransposeOp, The input channel should be the same "
@@ -62,13 +62,14 @@ Conv2DTransposeOpMaker::Conv2DTransposeOpMaker(
62
62
" The format of input tensor is NCHW. Where N is batch size, C is the "
63
63
" number of input channels, H is the height of the feature, and "
64
64
" W is the width of the feature." );
65
- AddInput (" Filter" ,
66
- " (Tensor) The filter tensor of convolution transpose operator. "
67
- " The format of the filter tensor is CMHW, where C is the number of "
68
- " output image channels, M is the number of input image channels, "
69
- " H is the height of the filter, and W is the width of the filter. "
70
- " We enforce groups number == 1 and padding == 0 in "
71
- " the convolution transpose scenario." );
65
+ AddInput (
66
+ " Filter" ,
67
+ " (Tensor) The filter tensor of convolution transpose operator. "
68
+ " The format of the filter tensor is MCHW, where M is the number of "
69
+ " input feature channels, C is the number of "
70
+ " output feature channels,"
71
+ " H is the height of the filter, and W is the width of the filter. "
72
+ " We enforce groups number == 1 in the convolution transpose scenario." );
72
73
AddOutput (" Output" ,
73
74
" (Tensor) The output tensor of convolution transpose operator. "
74
75
" The format of output tensor is also NCHW." );
@@ -88,21 +89,26 @@ Convolution2D Transpose Operator.
88
89
The convolution transpose operation calculates the output based on the input, filter
89
90
and strides, paddings, groups parameters. The size of each dimension of the
90
91
parameters is checked in the infer-shape.
91
-
92
- Input(Input, Filter) and output(Output) are in NCHW format. Where N is batch
93
- size, C is the number of channels, H is the height of the feature, and
94
- W is the width of the feature. Parameters(ksize, strides, paddings) are two elements.
95
- These two elements represent height and width, respectively.
92
+ Input(Input) and output(Output) are in NCHW format. Where N is batchsize, C is the
93
+ number of channels, H is the height of the feature, and W is the width of the feature.
94
+ Filter(Input) is in MCHW format. Where M is the number of input feature channels,
95
+ C is the number of output feature channels, H is the height of the filter,
96
+ and W is the width of the filter.
97
+ Parameters(strides, paddings) are two elements. These two elements represent height
98
+ and width, respectively.
96
99
The input(X) size and output(Out) size may be different.
100
+
97
101
Example:
98
102
Input:
99
- Input shape: (N, C_in, H_in, W_in)
100
- Filter shape: (C_in, C_out , H_f, W_f)
103
+ Input shape: $ (N, C_{in}, H_{in}, W_{in})$
104
+ Filter shape: $(C_{in}, C_{out} , H_f, W_f)$
101
105
Output:
102
- Output shape: (N, C_out, H_out, W_out)
103
- where
104
- H_out = (H_in - 1) * strides[0] - 2 * paddings[0] + H_f;
105
- W_out = (W_in - 1) * strides[1] - 2 * paddings[1] + W_f;
106
+ Output shape: $(N, C_{out}, H_{out}, W_{out})$
107
+ Where
108
+ $$
109
+ H_{out} = (H_{in} - 1) * strides[0] - 2 * paddings[0] + H_f \\
110
+ W_{out} = (W_{in} - 1) * strides[1] - 2 * paddings[1] + W_f
111
+ $$
106
112
)DOC" );
107
113
}
108
114
@@ -117,8 +123,9 @@ Conv3DTransposeOpMaker::Conv3DTransposeOpMaker(
117
123
" W is the width of the feature." );
118
124
AddInput (" Filter" ,
119
125
" (Tensor) The filter tensor of convolution transpose operator."
120
- " The format of the filter tensor is CMDHW, where C is the number of "
121
- " output image channels, M is the number of input image channels, D "
126
+ " The format of the filter tensor is MCDHW, where M is the number of "
127
+ " input feature channels, C is the number of "
128
+ " output feature channels, D "
122
129
" is the depth of the filter, H is the height of the filter, and "
123
130
" W is the width of the filter."
124
131
" We enforce groups number == 1 and padding == 0 in "
@@ -144,23 +151,28 @@ Convolution3D Transpose Operator.
144
151
The convolution transpose operation calculates the output based on the input, filter
145
152
and strides, paddings, groups parameters. The size of each dimension of the
146
153
parameters is checked in the infer-shape.
147
-
148
- Input(Input, Filter) and output(Output) are in NCDHW format. Where N is batch
149
- size, C is the number of channels, D is the depth of the feature,
150
- H is the height of the feature, and W is the width of the feature.
151
- Parameters(ksize, strides, paddings) are three elements.
152
- These three elements represent depth, height and width, respectively.
154
+ Input(Input) and output(Output) are in NCDHW format. Where N is batch size, C is the
155
+ number of channels, D is the depth of the feature, H is the height of the feature,
156
+ and W is the width of the feature.
157
+ Filter(Input) is in MCDHW format. Where M is the number of input feature channels,
158
+ C is the number of output feature channels, D is the depth of the filter,H is the
159
+ height of the filter, and W is the width of the filter.
160
+ Parameters(strides, paddings) are three elements. These three elements represent
161
+ depth, height and width, respectively.
153
162
The input(X) size and output(Out) size may be different.
154
- Example:
163
+
164
+ Example:
155
165
Input:
156
- Input shape: (N, C_in, D_in, H_in, W_in)
157
- Filter shape: (C_in, C_out , D_f, H_f, W_f)
166
+ Input shape: $ (N, C_{in}, D_{in}, H_{in}, W_{in})$
167
+ Filter shape: $(C_{in}, C_{out} , D_f, H_f, W_f)$
158
168
Output:
159
- Output shape: (N, C_out, D_out, H_out, W_out)
160
- where
161
- D_out = (D_in - 1) * strides[0] - 2 * paddings[0] + D_f;
162
- H_out = (H_in - 1) * strides[1] - 2 * paddings[1] + H_f;
163
- W_out = (W_in - 1) * strides[2] - 2 * paddings[2] + W_f;
169
+ Output shape: $(N, C_{out}, D_{out}, H_{out}, W_{out})$
170
+ Where
171
+ $$
172
+ D_{out} = (D_{in} - 1) * strides[0] - 2 * paddings[0] + D_f \\
173
+ H_{out} = (H_{in} - 1) * strides[1] - 2 * paddings[1] + H_f \\
174
+ W_{out} = (W_{in} - 1) * strides[2] - 2 * paddings[2] + W_f
175
+ $$
164
176
)DOC" );
165
177
}
166
178
0 commit comments