Public Member Functions | |
Tensor & | operator= (const Tensor &)=default |
virtual const ngraph::Shape & | get_shape () const |
Get tensor shape. More... | |
const ngraph::PartialShape & | get_partial_shape () const |
Get tensor partial shape. More... | |
virtual const element::Type & | get_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::Tensor > | m_descriptor |
bool | m_stale |
|
virtual |
Get number of elements in the tensor.
|
virtual |
Get tensor element type.
const std::string& ngraph::runtime::Tensor::get_name | ( | ) | const |
Get tensor's unique name.
const ngraph::PartialShape& ngraph::runtime::Tensor::get_partial_shape | ( | ) | const |
Get tensor partial shape.
|
virtual |
Get tensor shape.
|
virtual |
Get the size in bytes of the tensor.
bool ngraph::runtime::Tensor::get_stale | ( | ) | const |
Get the stale value of the tensor. A tensor is stale if its data is changed.
|
pure virtual |
Read bytes directly from the tensor.
p | Pointer to destination for data |
n | Number of bytes to read, must be integral number of elements. |
|
pure virtual |
Write bytes directly into the tensor.
p | Pointer to source of data |
n | Number of bytes to write, must be integral number of elements. |