KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
PROJECT_NS::Shape Class Reference

Shape class provide information about of a Tensor's shape. More...

#include <Shape.h>

Collaboration diagram for PROJECT_NS::Shape:
Collaboration graph

Public Member Functions

 Shape (std::size_t size)
 < construct from a number (rank-1 Shape)
 
 Shape (std::vector< std::size_t > dims)
 construct from a vector of std::size_t pointer (dynamic shape)
 
 Shape (std::vector< std::size_t * > dims_ptr)
 get rank of a Shape
 
int rank ()
 get data size described by a Shape
 
int size ()
 
int operator() ()
 
std::vector< std::size_t > & dims ()
 
void static_build ()
 
std::string to_string ()
 

Private Member Functions

void update ()
 

Private Attributes

bool enable_dynamic = false
 
std::size_t _rank
 rank of the shape
 
std::vector< std::size_t * > _dims_ptr
 pointers to dimensions for each rank
 
std::vector< std::size_t > _dims
 dimensions for each rank
 
std::vector< std::size_t > _ldims
 leading dimensions
 
std::size_t _size
 size of data
 

Detailed Description

Shape class provide information about of a Tensor's shape.

Definition at line 50 of file Shape.h.

Constructor & Destructor Documentation

◆ Shape() [1/3]

PROJECT_NS::Shape::Shape ( std::size_t size)
inline

< construct from a number (rank-1 Shape)

construct from a vector (static shape)

Definition at line 53 of file Shape.h.

References size().

Here is the call graph for this function:

◆ Shape() [2/3]

PROJECT_NS::Shape::Shape ( std::vector< std::size_t > dims)
inline

construct from a vector of std::size_t pointer (dynamic shape)

Definition at line 56 of file Shape.h.

◆ Shape() [3/3]

PROJECT_NS::Shape::Shape ( std::vector< std::size_t * > dims_ptr)
inline

get rank of a Shape

Definition at line 62 of file Shape.h.

Member Function Documentation

◆ dims()

std::vector< std::size_t > & PROJECT_NS::Shape::dims ( )
inline

Definition at line 85 of file Shape.h.

◆ operator()()

int PROJECT_NS::Shape::operator() ( )
inline

Definition at line 83 of file Shape.h.

◆ rank()

int PROJECT_NS::Shape::rank ( )
inline

get data size described by a Shape

Definition at line 72 of file Shape.h.

◆ size()

int PROJECT_NS::Shape::size ( )
inline

Definition at line 78 of file Shape.h.

Referenced by Shape(), and PROJECT_NS::Tensor< T >::Tensor().

Here is the caller graph for this function:

◆ static_build()

void PROJECT_NS::Shape::static_build ( )
inline

Definition at line 90 of file Shape.h.

Referenced by PROJECT_NS::Dimension::static_build_shapes().

Here is the caller graph for this function:

◆ to_string()

std::string PROJECT_NS::Shape::to_string ( )
inline

Definition at line 95 of file Shape.h.

Referenced by PROJECT_NS::VariableDescriptor::referIn().

Here is the caller graph for this function:

◆ update()

void PROJECT_NS::Shape::update ( )
inlineprivate

Definition at line 104 of file Shape.h.

Member Data Documentation

◆ _dims

std::vector<std::size_t> PROJECT_NS::Shape::_dims
private

dimensions for each rank

Definition at line 122 of file Shape.h.

◆ _dims_ptr

std::vector<std::size_t*> PROJECT_NS::Shape::_dims_ptr
private

pointers to dimensions for each rank

Definition at line 121 of file Shape.h.

◆ _ldims

std::vector<std::size_t> PROJECT_NS::Shape::_ldims
private

leading dimensions

Definition at line 123 of file Shape.h.

◆ _rank

std::size_t PROJECT_NS::Shape::_rank
private

rank of the shape

Definition at line 120 of file Shape.h.

◆ _size

std::size_t PROJECT_NS::Shape::_size
private

size of data

Definition at line 124 of file Shape.h.

◆ enable_dynamic

bool PROJECT_NS::Shape::enable_dynamic = false
private

Definition at line 118 of file Shape.h.


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