Skip to main content

IConvolutionLayer

Struct IConvolutionLayer 

Source
pub struct IConvolutionLayer { /* private fields */ }
Expand description

! ! \class IConvolutionLayer ! ! \brief 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. ! ! \warning 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)

! ! \brief 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

! ! \brief Get the number of output maps for the convolution. ! ! \see setNbOutputMaps() !

Source

pub fn setNbGroups(self: Pin<&mut IConvolutionLayer>, nbGroups: i64)

! ! \brief Set the number of groups for a convolution. ! ! The input tensor channels are divided into \p 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. ! ! \note 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

! ! \brief Get the number of groups of the convolution. ! ! \see setNbGroups() !

Source

pub fn setKernelWeights(self: Pin<&mut IConvolutionLayer>, weights: Weights)

! ! \brief Set the kernel weights for the convolution. ! ! The weights are specified as a contiguous array in \p GKCRS order, where \p G is the number of groups, \p K ! the number of output feature maps, \p C the number of input channels, and \p R and \p S are the height and ! width of the filter. ! ! \see getKernelWeights() !

Source

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

! ! \brief Get the kernel weights of the convolution. ! ! \see setKernelWeights() !

Source

pub fn setBiasWeights(self: Pin<&mut IConvolutionLayer>, weights: Weights)

! ! \brief 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

! ! \brief Get the bias weights for the convolution. ! ! \see setBiasWeights() !

Source

pub fn setPrePadding(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)

! ! \brief 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

! ! \brief Get the pre-padding. ! ! \see setPrePadding() !

Source

pub fn setPostPadding(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)

! ! \brief 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

! ! \brief Get the post-padding. ! ! \see setPostPadding() !

Source

pub fn setPaddingMode( self: Pin<&mut IConvolutionLayer>, paddingMode: PaddingMode, )

! ! \brief 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

! ! \brief Get the padding mode. ! ! Default: kEXPLICIT_ROUND_DOWN ! ! \see setPaddingMode() !

Source

pub fn setKernelSizeNd(self: Pin<&mut IConvolutionLayer>, kernelSize: &Dims64)

! ! \brief 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

! ! \brief Get the multi-dimension kernel size of the convolution. ! ! \see setKernelSizeNd() !

Source

pub fn setStrideNd(self: Pin<&mut IConvolutionLayer>, stride: &Dims64)

! ! \brief 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

! ! \brief Get the multi-dimension stride of the convolution. ! ! \see setStrideNd() !

Source

pub fn setPaddingNd(self: Pin<&mut IConvolutionLayer>, padding: &Dims64)

! ! \brief 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

! ! \brief 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)

! ! \brief 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

! ! \brief Get the multi-dimension dilation of the convolution. ! ! \see setDilationNd() !

Trait Implementations§

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.