UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::NNE::FTensorShape Class Reference

#include <NNETypes.h>

Public Member Functions

 FTensorShape ()=default
 
 FTensorShape (const FTensorShape &OtherShape)=default
 
TConstArrayView< uint32GetData () const
 
int32 Rank () const
 
NNE_API uint64 Volume () const
 
NNE_API bool IsCompatibleWith (const FSymbolicTensorShape &SymbolicShape) const
 
NNE_API bool operator== (const FTensorShape &OtherShape) const
 
NNE_API bool operator!= (const FTensorShape &OtherShape) const
 
NNE_API void operator= (const FTensorShape &OtherShape)
 

Static Public Member Functions

static NNE_API FTensorShape Make (TConstArrayView< uint32 > Data)
 
static NNE_API FTensorShape MakeFromSymbolic (const FSymbolicTensorShape &SymbolicShape)
 

Static Public Attributes

static constexpr int32 MaxRank = FSymbolicTensorShape::MaxRank
 

Detailed Description

The concrete shape of a tensor.

Concrete tensor shapes are well defined through strictly positive values and thus have a defined volume.

Constructor & Destructor Documentation

◆ FTensorShape() [1/2]

UE::NNE::FTensorShape::FTensorShape ( )
default

Default construct a tensor shape.

◆ FTensorShape() [2/2]

UE::NNE::FTensorShape::FTensorShape ( const FTensorShape OtherShape)
default

Construct this tensor shape from another one.

Parameters
OtherShapethe other tensor shape to copy from.

Member Function Documentation

◆ GetData()

TConstArrayView< uint32 > UE::NNE::FTensorShape::GetData ( ) const
inline

Get the dimensions of the tensor shape.

Returns
a view on the dimensions of the tensor shape.

◆ IsCompatibleWith()

bool UE::NNE::FTensorShape::IsCompatibleWith ( const FSymbolicTensorShape SymbolicShape) const

Check if this tensor shape is part of the ensemble of shapes defined by the symbolic shape.

For example [1,2] is compatible with [-1,2] and [1,2] but not with [2,2] or [1,2,3].

Returns
true if this tensor shape is compatible with the symbolic shape, false otherwise.

◆ Make()

FTensorShape UE::NNE::FTensorShape::Make ( TConstArrayView< uint32 Data)
static

Construct a tensor shape with the given dimensions.

Parameters
Dataan array of dimensions.
Returns
a tensor shape with the given dimensions.

◆ MakeFromSymbolic()

FTensorShape UE::NNE::FTensorShape::MakeFromSymbolic ( const FSymbolicTensorShape SymbolicShape)
static

Construct a tensor shape from a symbolic tensor shape.

Negative dimension values are replaced by 1.

Parameters
SymbolicShapea symbolic tensor shape.
Returns
a tensor shape with the given dimensions.

◆ operator!=()

bool UE::NNE::FTensorShape::operator!= ( const FTensorShape OtherShape) const

Check if the tensor shape is different from another one.

Parameters
OtherShapethe other tensor shape.
Returns
true if the tensor shape is different from the other one, false otherwise.

◆ operator=()

void UE::NNE::FTensorShape::operator= ( const FTensorShape OtherShape)

Assign this tensor shape from another one.

Parameters
OtherShapethe other tensor shape to copy from.

◆ operator==()

bool UE::NNE::FTensorShape::operator== ( const FTensorShape OtherShape) const

Check if the tensor shape is equal to another one.

Parameters
OtherShapethe other tensor shape.
Returns
true if the tensor shape is equal to the other one, false otherwise.

◆ Rank()

int32 UE::NNE::FTensorShape::Rank ( ) const
inline

Get the number of dimensions of the tensor shape, aka the rank.

Returns
the number of dimensions of the tensor shape.

◆ Volume()

uint64 UE::NNE::FTensorShape::Volume ( ) const

Get the number of elements in this tensor shape.

Returns
the number of element in this tensor shape.

Member Data Documentation

◆ MaxRank

constexpr int32 UE::NNE::FTensorShape::MaxRank = FSymbolicTensorShape::MaxRank
staticconstexpr

The maximum number of dimensions supported by the tensor shape, aka the rank.


The documentation for this class was generated from the following files: