NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::TensorDimension Struct Reference

TensorDimension describes the dimensions of a four-dimensional image tensor. More...

#include <nvneural/CoreTypes.h>

Public Member Functions

std::size_t elementCount () const
 Returns the number of elements in a tensor with these dimensions. More...
 
bool operator!= (const TensorDimension &other) const
 Inequality operator.
 
TensorDimensionoperator= (const TensorDimension &copyFrom)
 Copy assignment operator.
 
bool operator== (const TensorDimension &other) const
 Equality operator.
 
 TensorDimension ()=default
 Default constructor. Initializes all members to zero.
 
 TensorDimension (const TensorDimension &copyFrom)
 Copy constructor.
 
 TensorDimension (size_t N, size_t C, size_t H, size_t W)
 Direct constructor, specifying all members at once.
 
 ~TensorDimension ()=default
 Trivial destructor.
 

Public Attributes

size_t c = 0
 C dimension (channel)
 
size_t h = 0
 H dimension (height)
 
size_t n = 0
 N dimension (batch)
 
size_t w = 0
 W dimension (width)
 

Detailed Description

TensorDimension describes the dimensions of a four-dimensional image tensor.

Its member functions are provided for convenience and may change implementations between versions of the nvneural SDK, but the binary layout of this type will remain constant.

Member Function Documentation

◆ elementCount()

std::size_t nvneural::TensorDimension::elementCount ( ) const
inline

Returns the number of elements in a tensor with these dimensions.

This can be used to compute buffer size by multiplying by sizeof(element).


The documentation for this struct was generated from the following file: