Public Member Functions
ngraph::runtime::HostTensor Class Reference
Inheritance diagram for ngraph::runtime::HostTensor:
Inheritance graph
[legend]
Collaboration diagram for ngraph::runtime::HostTensor:
Collaboration graph
[legend]

Public Member Functions

 HostTensor (const element::Type &element_type, const Shape &shape, void *memory_pointer, const std::string &name="")
 
 HostTensor (const element::Type &element_type, const Shape &shape, const std::string &name="")
 
 HostTensor (const element::Type &element_type, const PartialShape &partial_shape, const std::string &name="")
 
 HostTensor (const std::string &name="")
 
 HostTensor (const Output< Node > &)
 
 HostTensor (const std::shared_ptr< op::v0::Constant > &constant)
 
void initialize (const std::shared_ptr< op::v0::Constant > &constant)
 
void * get_data_ptr ()
 
const void * get_data_ptr () const
 
template<typename T >
T * get_data_ptr ()
 
template<typename T >
const T * get_data_ptr () const
 
template<element::Type_t ET>
element_type_traits< ET >::value_type * get_data_ptr ()
 
template<element::Type_t ET>
const element_type_traits< ET >::value_type * get_data_ptr () const
 
void write (const void *p, size_t n) override
 Write bytes directly into the tensor. More...
 
void read (void *p, size_t n) const override
 Read bytes directly from the tensor. More...
 
bool get_is_allocated () const
 
void set_element_type (const element::Type &element_type)
 Set the element type. Must be compatible with the current element type. More...
 
void set_shape (const Shape &shape)
 Set the actual shape of the tensor compatibly with the partial shape. More...
 
void set_unary (const HostTensorPtr &arg)
 Set the shape of a node from an input. More...
 
void set_broadcast (const op::AutoBroadcastSpec &autob, const HostTensorPtr &arg0, const HostTensorPtr &arg1)
 Set the shape of the tensor using broadcast rules. More...
 
void set_broadcast (const op::AutoBroadcastSpec &autob, const HostTensorPtr &arg0, const HostTensorPtr &arg1, const element::Type &element_type)
 Set the shape of the tensor using broadcast rules. More...
 
- Public Member Functions inherited from ngraph::runtime::Tensor
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 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.
 

Additional Inherited Members

- Protected Member Functions inherited from ngraph::runtime::Tensor
 Tensor (const std::shared_ptr< ngraph::descriptor::Tensor > &descriptor)
 
- Protected Attributes inherited from ngraph::runtime::Tensor
std::shared_ptr< ngraph::descriptor::Tensorm_descriptor
 
bool m_stale
 

Member Function Documentation

◆ read()

void ngraph::runtime::HostTensor::read ( void *  p,
size_t  n 
) const
overridevirtual

Read bytes directly from the tensor.

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

Implements ngraph::runtime::Tensor.

◆ set_broadcast() [1/2]

void ngraph::runtime::HostTensor::set_broadcast ( const op::AutoBroadcastSpec autob,
const HostTensorPtr &  arg0,
const HostTensorPtr &  arg1 
)

Set the shape of the tensor using broadcast rules.

Parameters
autobThe broadcast mode
arg0The first argument
arg1The second argument

◆ set_broadcast() [2/2]

void ngraph::runtime::HostTensor::set_broadcast ( const op::AutoBroadcastSpec autob,
const HostTensorPtr &  arg0,
const HostTensorPtr &  arg1,
const element::Type element_type 
)

Set the shape of the tensor using broadcast rules.

Parameters
autobThe broadcast mode
arg0The first argument
arg1The second argument
element_typeThe output element type

◆ set_element_type()

void ngraph::runtime::HostTensor::set_element_type ( const element::Type element_type)

Set the element type. Must be compatible with the current element type.

Parameters
element_typeThe element type

◆ set_shape()

void ngraph::runtime::HostTensor::set_shape ( const Shape shape)

Set the actual shape of the tensor compatibly with the partial shape.

Parameters
shapeThe shape being set

◆ set_unary()

void ngraph::runtime::HostTensor::set_unary ( const HostTensorPtr &  arg)

Set the shape of a node from an input.

Parameters
argThe input argument

◆ write()

void ngraph::runtime::HostTensor::write ( const void *  p,
size_t  n 
)
overridevirtual

Write bytes directly into the tensor.

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

Implements ngraph::runtime::Tensor.


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