Class TensorBase¶
Defined in File tensor.h
Class Documentation¶
-
class
TensorBase
¶ Main implementation of a tensor, a multi-dimensional matrix containing elements of a single data type.
TensorBase contains the data, data type, pointer to memory region, shape, backend info and other attributes.
Public Types
-
typedef IPtr<TensorBase>
PtrType
¶
Public Functions
-
virtual
~TensorBase
()¶
-
virtual void
reset
(MemoryPiece::PtrType memory)¶
-
virtual MemoryPiece::PtrType
memory
()¶
-
virtual float *
data
()¶
-
virtual size_t
size
()¶
-
virtual float
scalar
()¶
-
Tensor
subtensor
(size_t offset, size_t size)¶
-
float
get
(size_t i)¶
-
template<typename
T
>
voidcopyFrom
(Tensor in)¶
-
void
copyFrom
(Tensor in)¶
-
template<typename
T
>
voidswap
(Tensor swapee)¶
-
void
swap
(Tensor swapee)¶
-
template std::string marian::TensorBase::debug< int64_t >(int precision = 8, int dispCols = 5)
-
size_t
hash
()¶
-
typedef IPtr<TensorBase>