Public Member Functions | Protected Member Functions | Protected Attributes
ngraph::runtime::Tensor Class Referenceabstract
Inheritance diagram for ngraph::runtime::Tensor:
Inheritance graph
[legend]

Public Member Functions

Tensoroperator= (const Tensor &)=default
 
virtual const ngraph::Shapeget_shape () const
 Get tensor shape. More...
 
const ngraph::PartialShapeget_partial_shape () const
 Get tensor partial shape. More...
 
virtual const element::Typeget_element_type () const
 Get tensor element type. More...
 
virtual size_t get_element_count () const
 Get number of elements in the tensor. More...
 
virtual size_t get_size_in_bytes () const
 Get the size in bytes of the tensor. More...
 
const std::string & get_name () const
 Get tensor's unique name. More...
 
bool get_stale () const
 Get the stale value of the tensor. A tensor is stale if its data is changed. More...
 
void set_stale (bool val)
 Set the stale value of the tensor. A tensor is stale if its data is changed.
 
virtual void write (const void *p, size_t n)=0
 Write bytes directly into the tensor. More...
 
virtual void read (void *p, size_t n) const =0
 Read bytes directly from the tensor. More...
 
virtual void wait_for_read_ready ()
 check tensor for new data, call may block. backends may use this to ensure tensor is updated (eg: lazy eval).
 
virtual void wait_for_write_ready ()
 notify tensor of new data, call may block. backends may use this as indication of new data in tensor.
 

Protected Member Functions

 Tensor (const std::shared_ptr< ngraph::descriptor::Tensor > &descriptor)
 

Protected Attributes

std::shared_ptr< ngraph::descriptor::Tensorm_descriptor
 
bool m_stale
 

Member Function Documentation

◆ get_element_count()

virtual size_t ngraph::runtime::Tensor::get_element_count ( ) const
virtual

Get number of elements in the tensor.

Returns
number of elements in the tensor

◆ get_element_type()

virtual const element::Type& ngraph::runtime::Tensor::get_element_type ( ) const
virtual

Get tensor element type.

Returns
element::Type

◆ get_name()

const std::string& ngraph::runtime::Tensor::get_name ( ) const

Get tensor's unique name.

Returns
tensor's name

◆ get_partial_shape()

const ngraph::PartialShape& ngraph::runtime::Tensor::get_partial_shape ( ) const

Get tensor partial shape.

Returns
const reference to a PartialShape

◆ get_shape()

virtual const ngraph::Shape& ngraph::runtime::Tensor::get_shape ( ) const
virtual

Get tensor shape.

Returns
const reference to a Shape

◆ get_size_in_bytes()

virtual size_t ngraph::runtime::Tensor::get_size_in_bytes ( ) const
virtual

Get the size in bytes of the tensor.

Returns
number of bytes in tensor's allocation

◆ get_stale()

bool ngraph::runtime::Tensor::get_stale ( ) const

Get the stale value of the tensor. A tensor is stale if its data is changed.

Returns
true if there is new data in this tensor

◆ read()

virtual void ngraph::runtime::Tensor::read ( void *  p,
size_t  n 
) const
pure virtual

Read bytes directly from the tensor.

Parameters
pPointer to destination for data
nNumber of bytes to read, must be integral number of elements.

Implemented in ngraph::runtime::HostTensor.

◆ write()

virtual void ngraph::runtime::Tensor::write ( const void *  p,
size_t  n 
)
pure virtual

Write bytes directly into the tensor.

Parameters
pPointer to source of data
nNumber of bytes to write, must be integral number of elements.

Implemented in ngraph::runtime::HostTensor.


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