KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
PROJECT_NS::Tensor< T > Class Template Referencefinal

Tensor class is the container for array-like data. More...

#include <Tensor.h>

Inheritance diagram for PROJECT_NS::Tensor< T >:
Inheritance graph
Collaboration diagram for PROJECT_NS::Tensor< T >:
Collaboration graph

Public Types

using SizeType = std::size_t
 
using DataType = T
 

Public Member Functions

 Tensor (Shape S, const std::string &info="")
 
virtual std::string repr ()
 
virtual std::string help (const std::string &name)
 
T * data ()
 
std::size_t size ()
 
Shapeshape ()
 
kids_dtype type ()
 

Protected Attributes

kids_dtype _type = kids_void_type
 

Private Attributes

std::size_t _size
 
Shape _shape
 
std::string _doc_info
 
std::shared_ptr< std::vector< T > > _data
 

Detailed Description

template<typename T>
class PROJECT_NS::Tensor< T >

Tensor class is the container for array-like data.

Definition at line 43 of file Tensor.h.

Member Typedef Documentation

◆ DataType

template<typename T >
using PROJECT_NS::Tensor< T >::DataType = T

Definition at line 46 of file Tensor.h.

◆ SizeType

template<typename T >
using PROJECT_NS::Tensor< T >::SizeType = std::size_t

Definition at line 45 of file Tensor.h.

Constructor & Destructor Documentation

◆ Tensor()

template<typename T >
PROJECT_NS::Tensor< T >::Tensor ( Shape S,
const std::string & info = "" )
inline

Member Function Documentation

◆ data()

template<typename T >
T * PROJECT_NS::Tensor< T >::data ( )
inline

Definition at line 66 of file Tensor.h.

References PROJECT_NS::Tensor< T >::_data.

◆ help()

template<typename T >
virtual std::string PROJECT_NS::Tensor< T >::help ( const std::string & name)
inlinevirtual

Implements PROJECT_NS::Node.

Definition at line 64 of file Tensor.h.

References PROJECT_NS::Tensor< T >::_doc_info.

◆ repr()

template<typename T >
virtual std::string PROJECT_NS::Tensor< T >::repr ( )
inlinevirtual

Implements PROJECT_NS::Node.

Definition at line 54 of file Tensor.h.

References PROJECT_NS::Tensor< T >::_data, PROJECT_NS::Tensor< T >::_size, and FMT.

◆ shape()

template<typename T >
Shape & PROJECT_NS::Tensor< T >::shape ( )
inline

Definition at line 70 of file Tensor.h.

References PROJECT_NS::Tensor< T >::_shape.

◆ size()

template<typename T >
std::size_t PROJECT_NS::Tensor< T >::size ( )
inline

Definition at line 68 of file Tensor.h.

References PROJECT_NS::Tensor< T >::_size.

◆ type()

kids_dtype PROJECT_NS::Node::type ( )
inlineinherited

Definition at line 45 of file Node.h.

References PROJECT_NS::Node::_type.

Referenced by PROJECT_NS::DataSet::help(), and PROJECT_NS::DataSet::repr().

Here is the caller graph for this function:

Member Data Documentation

◆ _data

template<typename T >
std::shared_ptr<std::vector<T> > PROJECT_NS::Tensor< T >::_data
private

◆ _doc_info

template<typename T >
std::string PROJECT_NS::Tensor< T >::_doc_info
private

Definition at line 75 of file Tensor.h.

Referenced by PROJECT_NS::Tensor< T >::help().

◆ _shape

template<typename T >
Shape PROJECT_NS::Tensor< T >::_shape
private

Definition at line 74 of file Tensor.h.

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

◆ _size

template<typename T >
std::size_t PROJECT_NS::Tensor< T >::_size
private

◆ _type

kids_dtype PROJECT_NS::Node::_type = kids_void_type
protectedinherited

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