Skip to main content

IDeconvolutionLayer

Struct IDeconvolutionLayer 

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

IDeconvolutionLayer

A deconvolution layer in a network definition.

Do not inherit from this class, as doing so will break forward-compatibility of the API and ABI.

Implementations§

Source§

impl IDeconvolutionLayer

Source

pub fn setNbOutputMaps(self: Pin<&mut IDeconvolutionLayer>, nbOutputMaps: i64)

Set the number of output feature maps for the deconvolution.

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: &IDeconvolutionLayer) -> i64

Get the number of output feature maps for the deconvolution.

See [setNbOutputMaps()]

Source

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

Set the number of groups for a deconvolution.

The input tensor channels are divided into nbGroups groups, and a deconvolution is executed for each group, using a filter per group. The results of the group convolutions are concatenated to form the output.

If executing this layer on DLA, nbGroups must be one

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

See [getNbGroups()]

Source

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

Get the number of groups for a deconvolution.

See [setNbGroups()]

Source

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

Set the kernel weights for the deconvolution.

The weights are specified as a contiguous array in CKRS order, where C the number of input channels, K the number of output feature maps, and R and S are the height and width of the filter.

See [getWeights()]

Source

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

Get the kernel weights for the deconvolution.

See [setNbGroups()]

Source

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

Set the bias weights for the deconvolution.

Bias is optional. To omit bias, set the count value of the weights structure to zero.

The bias is applied per-feature-map, 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: &IDeconvolutionLayer) -> Weights

Get the bias weights for the deconvolution.

See [getBiasWeights()]

Source

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

Set the multi-dimension pre-padding of the deconvolution.

The output will be trimmed by this number of elements on the start of every dimension. In other words, it resembles the inverse of a convolution layer with this padding size. Negative padding is not supported.

Default: (0, 0, …, 0)

See [getPrePadding()]

Source

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

Get the pre-padding.

See [setPrePadding()]

Source

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

Set the multi-dimension post-padding of the deconvolution.

The output will be trimmed by this number of elements on the end of every dimension. In other words, it resembles the inverse of a convolution layer with this padding size. Negative padding is not supported.

Default: (0, 0, …, 0)

See [getPostPadding()]

Source

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

Get the padding.

See [setPostPadding()]

Source

pub fn setPaddingMode( self: Pin<&mut IDeconvolutionLayer>, 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: &IDeconvolutionLayer) -> PaddingMode

Get the padding mode.

Default: kEXPLICIT_ROUND_DOWN

See [setPaddingMode()]

Source

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

Set the multi-dimension kernel size of the deconvolution.

If executing this layer on DLA, there are two restrictions:

  1. Only 2D Kernel is supported.
  2. Kernel height and width must be in the range [1,32] or the combinations of [64, 96, 128] in one dimension and 1 in the other dimensions, i.e. [1x64] or [64x1] are valid, but not [64x64].

See [getKernelSizeNd()]

Source

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

Get the multi-dimension kernel size of the deconvolution.

See [setKernelSizeNd()]

Source

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

Set the multi-dimension stride of the deconvolution.

Default: (1, 1, …, 1)

If executing this layer on DLA, there are two restrictions:

  1. Only 2D Stride is supported.
  2. Stride height and width must be in the range [1,32] or the combinations of [64, 96, 128] in one dimension and 1 in the other dimensions, i.e. [1x64] or [64x1] are valid, but not [64x64].

See [getStrideNd()]

Source

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

Get the multi-dimension stride of the deconvolution.

See [setStrideNd()]

Source

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

Set the multi-dimension padding of the deconvolution.

The output will be trimmed by this number of elements on both sides of every dimension. In other words, it resembles the inverse of a convolution layer with this padding size. Padding is symmetric, and negative padding is not supported.

Default: (0, 0, …, 0)

If executing this layer on DLA, padding must be 0.

See [getPaddingNd()] setPadding() getPadding()

Source

pub fn getPaddingNd(self: &IDeconvolutionLayer) -> Dims64

Get the multi-dimension padding of the deconvolution.

If the padding is asymmetric, the pre-padding is returned.

See [setPaddingNd()]

Source

pub fn setDilationNd(self: Pin<&mut IDeconvolutionLayer>, dilation: &Dims64)

Set the multi-dimension dilation of the deconvolution.

Default: (1, 1, …, 1)

See [getDilationNd()]

Source

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

Get the multi-dimension dilation of the deconvolution.

See [setDilationNd()]

Trait Implementations§

Source§

impl AsLayer for IDeconvolutionLayer

Source§

fn as_layer(&self) -> &ILayer

Source§

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

Source§

impl AsLayerTyped for IDeconvolutionLayer

Source§

const TYPE: LayerType = LayerType::kDECONVOLUTION

Source§

impl AsRef<ILayer> for IDeconvolutionLayer

Source§

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

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

impl ExternType for IDeconvolutionLayer

Source§

type Id = (n, v, i, n, f, e, r, _1, (), I, D, e, 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 IDeconvolutionLayer

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut IDeconvolutionLayer

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

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.