提交 8aff6654 编写于 作者: C Channingss

conv2dtanspose out_size to out_padding

上级 6cf21662
...@@ -1748,16 +1748,19 @@ class OpSet9(): ...@@ -1748,16 +1748,19 @@ class OpSet9():
output_size[1] = (val_x.out_shapes[0][3] - 1 output_size[1] = (val_x.out_shapes[0][3] - 1
) * strides[1] - 2 * paddings[1] + dilations[1] * ( ) * strides[1] - 2 * paddings[1] + dilations[1] * (
kernel_shape[1] - 1) + 1 + out_padding[1] kernel_shape[1] - 1) + 1 + out_padding[1]
output_padding =
# Conv2DTranspose缺少output_size,只能在forward里头传进output_size # Conv2DTranspose缺少output_size,只能在forward里头传进output_size
inputs_dict = {'x': val_x if isinstance(val_x, str) else val_x.name} inputs_dict = {'x': val_x if isinstance(val_x, str) else val_x.name}
layer_attrs = { layer_attrs = {
"in_channels": num_in_channels, "in_channels": num_in_channels,
"out_channels": num_out_channels, "out_channels": num_out_channels,
'kernel_size': kernel_shape, "kernel_size": kernel_shape,
"stride": strides, "stride": strides,
"dilation": dilations, "dilation": dilations,
"padding": paddings, "padding": paddings,
"groups": num_groups} "groups": num_groups,
"output_padding":out_padding}
self.weights[op_name + '.weight'] = self.weights[val_w.name] self.weights[op_name + '.weight'] = self.weights[val_w.name]
if val_b is not None: if val_b is not None:
self.weights[op_name + '.bias'] = self.weights[val_b.name] self.weights[op_name + '.bias'] = self.weights[val_b.name]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册