Skip to main content

IConvolutionLayer

Struct IConvolutionLayer 

Source
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

Source

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()]

Source

pub fn getNbOutputMaps(self: &IConvolutionLayer) -> i64

Get the number of output maps for the convolution.

See [setNbOutputMaps()]

Source

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()]

Source

pub fn getNbGroups(self: &IConvolutionLayer) -> i64

Get the number of groups of the convolution.

See [setNbGroups()]

Source

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()]

Source

pub fn getKernelWeights(self: &IConvolutionLayer) -> Weights

Get the kernel weights of the convolution.

See [setKernelWeights()]

Source

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()]

Source

pub fn getBiasWeights(self: &IConvolutionLayer) -> Weights

Get the bias weights for the convolution.

See [setBiasWeights()]

Source

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()]

Source

pub fn getPrePadding(self: &IConvolutionLayer) -> Dims64

Get the pre-padding.

See [setPrePadding()]

Source

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()]

Source

pub fn getPostPadding(self: &IConvolutionLayer) -> Dims64

Get the post-padding.

See [setPostPadding()]

Source

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()]

Source

pub fn getPaddingMode(self: &IConvolutionLayer) -> PaddingMode

Get the padding mode.

Default: kEXPLICIT_ROUND_DOWN

See [setPaddingMode()]

Source

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()]

Source

pub fn getKernelSizeNd(self: &IConvolutionLayer) -> Dims64

Get the multi-dimension kernel size of the convolution.

See [setKernelSizeNd()]

Source

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()]

Source

pub fn getStrideNd(self: &IConvolutionLayer) -> Dims64

Get the multi-dimension stride of the convolution.

See [setStrideNd()]

Source

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()

Source

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()]

Source

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()]

Source

pub fn getDilationNd(self: &IConvolutionLayer) -> Dims64

Get the multi-dimension dilation of the convolution.

See [setDilationNd()]

Trait Implementations§

Source§

impl AsLayer for IConvolutionLayer

Source§

fn as_layer(&self) -> &ILayer

Source§

fn as_layer_pin_mut(&mut self) -> Pin<&mut ILayer>

Source§

impl AsLayerTyped for IConvolutionLayer

Source§

const TYPE: LayerType = LayerType::kCONVOLUTION

Source§

impl AsRef<ILayer> for IConvolutionLayer

Source§

fn as_ref(self: &IConvolutionLayer) -> &ILayer

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl ExternType for IConvolutionLayer

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, C, o, n, v, o, l, u, t, i, o, n, L, a, y, e, r)

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

type Kind = Opaque

Source§

impl MakeCppStorage for IConvolutionLayer

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IConvolutionLayer

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut IConvolutionLayer)

Frees a C++ allocation which has not yet had a constructor called. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.