pub struct IConvolutionLayer { /* private fields */ }Expand description
IConvolutionLayer
A convolution layer in a network definition.
This layer performs a correlation operation between 3 or 4 dimensional filter with a 4 or 5 dimensional tensor to produce another 4 or 5 dimensional tensor.
An optional bias argument is supported, which adds a per-channel constant to each value in the output.
Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.
Implementations§
Source§impl IConvolutionLayer
impl IConvolutionLayer
Sourcepub fn setNbOutputMaps(self: Pin<&mut IConvolutionLayer>, nbOutputMaps: i64)
pub fn setNbOutputMaps(self: Pin<&mut IConvolutionLayer>, nbOutputMaps: i64)
Set the number of output maps for the convolution.
If executing this layer on DLA, the number of output maps must be in the range [1,8192].
See [getNbOutputMaps()]
Sourcepub fn getNbOutputMaps(self: &IConvolutionLayer) -> i64
pub fn getNbOutputMaps(self: &IConvolutionLayer) -> i64
Get the number of output maps for the convolution.
See [setNbOutputMaps()]
Sourcepub fn setNbGroups(self: Pin<&mut IConvolutionLayer>, nbGroups: i64)
pub fn setNbGroups(self: Pin<&mut IConvolutionLayer>, nbGroups: i64)
Set the number of groups for a convolution.
The input tensor channels are divided into nbGroups groups, and a convolution is executed for each group, using a filter per group. The results of the group convolutions are concatenated to form the output.
When using groups in int8 mode, the size of the groups (i.e. the channel count divided by the group count) must be a multiple of 4 for both input and output.
Default: 1
If executing this layer on DLA, the max number of groups is 8192.
See [getNbGroups()]
Sourcepub fn getNbGroups(self: &IConvolutionLayer) -> i64
pub fn getNbGroups(self: &IConvolutionLayer) -> i64
Get the number of groups of the convolution.
See [setNbGroups()]
Sourcepub fn setKernelWeights(self: Pin<&mut IConvolutionLayer>, weights: Weights)
pub fn setKernelWeights(self: Pin<&mut IConvolutionLayer>, weights: Weights)
Set the kernel weights for the convolution.
The weights are specified as a contiguous array in GKCRS order, where G is the number of groups, K the number of output feature maps, C the number of input channels, and R and S are the height and width of the filter.
See [getKernelWeights()]
Sourcepub fn getKernelWeights(self: &IConvolutionLayer) -> Weights
pub fn getKernelWeights(self: &IConvolutionLayer) -> Weights
Get the kernel weights of the convolution.
See [setKernelWeights()]
Sourcepub fn setBiasWeights(self: Pin<&mut IConvolutionLayer>, weights: Weights)
pub fn setBiasWeights(self: Pin<&mut IConvolutionLayer>, weights: Weights)
Set the bias weights for the convolution.
Bias is optional. To omit bias, set the count value of the weights structure to zero.
The bias is applied per-channel, so the number of weights (if non-zero) must be equal to the number of output feature maps.
See [getBiasWeights()]
Sourcepub fn getBiasWeights(self: &IConvolutionLayer) -> Weights
pub fn getBiasWeights(self: &IConvolutionLayer) -> Weights
Get the bias weights for the convolution.
See [setBiasWeights()]
Sourcepub fn setPrePadding(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)
pub fn setPrePadding(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)
Set the multi-dimension pre-padding of the convolution.
The start of the input will be zero-padded by this number of elements in each dimension.
Default: (0, 0, …, 0)
If executing this layer on DLA, only support 2D padding, both height and width of padding must be in the range [0,31], and the padding must be less than the kernel size.
See [getPrePadding()]
Sourcepub fn getPrePadding(self: &IConvolutionLayer) -> Dims64
pub fn getPrePadding(self: &IConvolutionLayer) -> Dims64
Get the pre-padding.
See [setPrePadding()]
Sourcepub fn setPostPadding(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)
pub fn setPostPadding(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)
Set the multi-dimension post-padding of the convolution.
The end of the input will be zero-padded by this number of elements in each dimension.
Default: (0, 0, …, 0)
If executing this layer on DLA, only support 2D padding, both height and width of padding must be in the range [0,31], and the padding must be less than the kernel size.
See [getPostPadding()]
Sourcepub fn getPostPadding(self: &IConvolutionLayer) -> Dims64
pub fn getPostPadding(self: &IConvolutionLayer) -> Dims64
Get the post-padding.
See [setPostPadding()]
Sourcepub fn setPaddingMode(
self: Pin<&mut IConvolutionLayer>,
paddingMode: PaddingMode,
)
pub fn setPaddingMode( self: Pin<&mut IConvolutionLayer>, paddingMode: PaddingMode, )
Set the padding mode.
Padding mode takes precedence if both setPaddingMode and setPre/PostPadding are used.
Default: kEXPLICIT_ROUND_DOWN
See [getPaddingMode()]
Sourcepub fn getPaddingMode(self: &IConvolutionLayer) -> PaddingMode
pub fn getPaddingMode(self: &IConvolutionLayer) -> PaddingMode
Get the padding mode.
Default: kEXPLICIT_ROUND_DOWN
See [setPaddingMode()]
Sourcepub fn setKernelSizeNd(self: Pin<&mut IConvolutionLayer>, kernelSize: &Dims64)
pub fn setKernelSizeNd(self: Pin<&mut IConvolutionLayer>, kernelSize: &Dims64)
Set the multi-dimension kernel size of the convolution.
If executing this layer on DLA, only support 2D kernel size, both height and width of kernel size must be in the range [1,32].
See [getKernelSizeNd()]
Sourcepub fn getKernelSizeNd(self: &IConvolutionLayer) -> Dims64
pub fn getKernelSizeNd(self: &IConvolutionLayer) -> Dims64
Get the multi-dimension kernel size of the convolution.
See [setKernelSizeNd()]
Sourcepub fn setStrideNd(self: Pin<&mut IConvolutionLayer>, stride: &Dims64)
pub fn setStrideNd(self: Pin<&mut IConvolutionLayer>, stride: &Dims64)
Set the multi-dimension stride of the convolution.
Default: (1, 1, …, 1)
If executing this layer on DLA, only support 2D stride, both height and width of stride must be in the range [1,8].
See [getStrideNd()]
Sourcepub fn getStrideNd(self: &IConvolutionLayer) -> Dims64
pub fn getStrideNd(self: &IConvolutionLayer) -> Dims64
Get the multi-dimension stride of the convolution.
See [setStrideNd()]
Sourcepub fn setPaddingNd(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)
pub fn setPaddingNd(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)
Set the multi-dimension padding of the convolution.
The input will be zero-padded by this number of elements in each dimension. Padding is symmetric.
Default: (0, 0, …, 0)
If executing this layer on DLA, only support 2D padding, both height and width of padding must be in the range [0,31], and the padding must be less than the kernel size.
See [getPaddingNd()] setPadding() getPadding()
Sourcepub fn getPaddingNd(self: &IConvolutionLayer) -> Dims64
pub fn getPaddingNd(self: &IConvolutionLayer) -> Dims64
Get the multi-dimension padding of the convolution.
If the padding is asymmetric, the pre-padding is returned.
See [setPaddingNd()]
Sourcepub fn setDilationNd(self: Pin<&mut IConvolutionLayer>, dilation: &Dims64)
pub fn setDilationNd(self: Pin<&mut IConvolutionLayer>, dilation: &Dims64)
Set the multi-dimension dilation of the convolution.
Default: (1, 1, …, 1)
If executing this layer on DLA, only support 2D padding, both height and width must be in the range [1,32].
See [getDilationNd()]
Sourcepub fn getDilationNd(self: &IConvolutionLayer) -> Dims64
pub fn getDilationNd(self: &IConvolutionLayer) -> Dims64
Get the multi-dimension dilation of the convolution.
See [setDilationNd()]