conv#
- ivy.conv(x, filters, strides, padding, /, *, transpose=False, dims=2, output_shape=None, data_format='channel_last', filter_format='channel_last', feature_group_count=1, x_dilations=1, dilations=1, bias=None, out=None)[source]#
Compute a 1-D, 2-D, and 3-D transpose or dilated convolution given 3-D, 4-D and 5-D input x respectively and filters arrays.
- Parameters:
x (
Union
[Array
,NativeArray
]) – Input image [batch_size,d,h,w,d_in] or [batch_size,d_in,d,h,w].filters (
Union
[Array
,NativeArray
]) – Convolution filters [fd,fh,fw,d_in/feature_group_count,d_out].strides (
Union
[int
,Tuple
[int
],Tuple
[int
,int
],Tuple
[int
,int
,int
]]) – The stride of the sliding window for each dimension of input.padding (
Union
[str
,Sequence
[Tuple
[int
,int
]]]) – either the string ‘SAME’ (padding with zeros evenly), the string ‘VALID’ (no padding), or a sequence of n (low, high) integer pairs that give the padding to apply before and after each spatial dimension.transpose (
bool
, default:False
) – True for computing transpose convolution, and False for dilated convolution. When True, x_dilations must be 1 (the default).dims (
int
, default:2
) – Either 1, 2, or 3 corresponding to 1-D, 2-D, and 3-D convolution.output_shape (
Optional
[Union
[Shape
,NativeShape
]], default:None
) – Shape of the output (Default value = None)data_format (
str
, default:'channel_last'
) – Either “channel_first” or “channel_last”. “channel_first” corresponds to “NCW”, “NCHW”, “NCDHW” input data formatS for 1-D, 2-D, 3-D convolution respectively, while “channel_last” corresponds to “NWC”, “NHWC”, “NDHWC” respectively.filter_format (
str
, default:'channel_last'
) – Either “channel_first” or “channel_last”. “channel_first” corresponds to “OIW”, “OIHW”, “OIDHW” input data formats for 1-D, 2-D, 3-D convolution respectively, while “channel_last” corresponds to “WIO”, “HWIO”, “DHWIO” respectively.feature_group_count (
int
, default:1
) – split input into groups, d_in should be divisible by the number of groups. (Default value = 1)x_dilations (
Union
[int
,Tuple
[int
],Tuple
[int
,int
],Tuple
[int
,int
,int
]], default:1
) – The dilation factor for each dimension of input. (Default value = 1)dilations (
Union
[int
,Tuple
[int
],Tuple
[int
,int
],Tuple
[int
,int
,int
]], default:1
) – The dilation factor for each dimension of input. (Default value = 1)bias (
Optional
[Union
[Array
,NativeArray
]], default:None
) – Bias array of shape [d_out].out (
Optional
[Array
], default:None
) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.
- Return type:
- Returns:
ret – The result of the transpose or dilated convolution operation.