conv¶
dragon.nn.
conv
(
inputs,
kernel_shape=(3, 3),
strides=1,
pads=0,
dilations=1,
group=1,
padding='VALID',
data_format='NCHW',
**kwargs
)[source]¶Apply the n-dimension convolution.
- If
data_format
is'NCHW'
, excepts input shape , weight shape , and output shape is . - If
data_format
is'NHWC'
, excepts input shape , weight shape , and output shape is . - If
padding
is'VALID'
,pads
controls the explicit padding size. Otherwise, size are computed automatically use the given method.
Examples:
- Parameters:
- inputs (Sequence[dragon.Tensor]) – The tensor
x
,weight
andbias
. - kernel_shape (Sequence[int], optional, default=(3, 3)) – The shape of convolution window.
- strides (Union[int, Sequence[int]], optional, default=1) – The stride of convolution window.
- pads (Union[int, Sequence[int]], optional, default=0) – The zero padding size.
- dilations (Union[int, Sequence[int]], optional, default=1) – The rate of dilated convolution.
- group (int, optional, default=1) – The number of groups to split channels into.
- padding (str, optional, default='VALID') –
'VALID'
,'SAME'
,'SAME_UPPER'
or'SAME_LOWER'
. - data_format (str, optional, default='NCHW') –
'NCHW'
or'NHWC'
.
- inputs (Sequence[dragon.Tensor]) – The tensor
- Returns:
dragon.Tensor – The output tensor.
- If