mindspore.ops.Conv2D
- class mindspore.ops.Conv2D(out_channel, kernel_size, mode=1, pad_mode='valid', pad=0, stride=1, dilation=1, group=1, data_format='NCHW')[source]
2D convolution layer.
Refer to
mindspore.ops.conv2d()
for more detail.- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> x = Tensor(np.ones([10, 32, 32, 32]), mindspore.float32) >>> weight = Tensor(np.ones([32, 32, 3, 3]), mindspore.float32) >>> conv2d = ops.Conv2D(out_channel=32, kernel_size=3) >>> output = conv2d(x, weight) >>> print(output.shape) (10, 32, 30, 30)