FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
Public Member Functions | List of all members
fast::TensorShape Class Reference

#include <TensorShape.hpp>

Public Member Functions

 TensorShape (std::initializer_list< int > dimensions)
 
 TensorShape (VectorXi dimensions)
 
 TensorShape (std::vector< int > dimensions)
 
 TensorShape (const TensorShape &other)
 
TensorShapeoperator= (const TensorShape &other)
 
 TensorShape ()
 
bool empty () const
 
int getTotalSize () const
 
int getDimensions () const
 
int getKnownDimensions () const
 
int getUnknownDimensions () const
 
std::vector< int > getAll () const
 
int & operator[] (int i)
 
const int & operator[] (int i) const
 
void setDimension (int i, int value)
 
void addDimension (int value)
 
void insertDimension (int position, int value)
 
std::string toString () const
 
void deleteDimension (int index)
 
void deleteDimensions (int startIndex, int endIndex)
 

Constructor & Destructor Documentation

◆ TensorShape() [1/5]

fast::TensorShape::TensorShape ( std::initializer_list< int >  dimensions)

Construct tensor shape

Parameters
dimensions

◆ TensorShape() [2/5]

fast::TensorShape::TensorShape ( VectorXi  dimensions)

Construct tensor shape

Parameters
dimensions

◆ TensorShape() [3/5]

fast::TensorShape::TensorShape ( std::vector< int >  dimensions)
explicit

Construct tensor shape

Parameters
dimensions

◆ TensorShape() [4/5]

fast::TensorShape::TensorShape ( const TensorShape other)

Copy constructor

Parameters
other

◆ TensorShape() [5/5]

fast::TensorShape::TensorShape ( )

Construct empty (invalid) tensor shape

Member Function Documentation

◆ addDimension()

void fast::TensorShape::addDimension ( int  value)

Add a dimension to the end of the shape with value

Parameters
value

◆ deleteDimension()

void fast::TensorShape::deleteDimension ( int  index)

Delete a dimension

Parameters
index

◆ deleteDimensions()

void fast::TensorShape::deleteDimensions ( int  startIndex,
int  endIndex 
)

Delete a range of dimensions

Parameters
startIndex
endIndex

◆ empty()

bool fast::TensorShape::empty ( ) const

If shape is empty or not

◆ getAll()

std::vector<int> fast::TensorShape::getAll ( ) const

Get all dimensions as vector

Returns

◆ getDimensions()

int fast::TensorShape::getDimensions ( ) const

Get nr of dimensions

Returns

◆ getKnownDimensions()

int fast::TensorShape::getKnownDimensions ( ) const

Get nr of known dimensions (dimension not -1)

Returns

◆ getTotalSize()

int fast::TensorShape::getTotalSize ( ) const

Total size of tensor, excluding any unknown dimensions

Returns

◆ getUnknownDimensions()

int fast::TensorShape::getUnknownDimensions ( ) const

Get nr of unknown dimensions (dimensions that are -1)

◆ insertDimension()

void fast::TensorShape::insertDimension ( int  position,
int  value 
)

Insert a new dimension at a given position with the given value

Parameters
position
value

◆ operator=()

TensorShape& fast::TensorShape::operator= ( const TensorShape other)

Assignment constructor

Parameters
other
Returns

◆ operator[]() [1/2]

int& fast::TensorShape::operator[] ( int  i)

◆ operator[]() [2/2]

const int& fast::TensorShape::operator[] ( int  i) const

◆ setDimension()

void fast::TensorShape::setDimension ( int  i,
int  value 
)

Set dimension i to value

Parameters
i
value

◆ toString()

std::string fast::TensorShape::toString ( ) const

Convert shape into string


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