22 #include "ngraph/descriptor/tensor.hpp"
23 #include "ngraph/shape.hpp"
24 #include "ngraph/strides.hpp"
25 #include "ngraph/type/element_type.hpp"
34 Tensor(
const std::shared_ptr<ngraph::descriptor::Tensor>& descriptor)
35 : m_descriptor(descriptor)
80 virtual void write(
const void* p,
size_t n) = 0;
85 virtual void read(
void* p,
size_t n)
const = 0;
94 std::shared_ptr<ngraph::descriptor::Tensor> m_descriptor;
virtual const element::Type & get_element_type() const
Get tensor element type.
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.
Definition: tensor.hpp:92
virtual const ngraph::Shape & get_shape() const
Get tensor shape.
Class representing a shape that may be partially or totally dynamic.
Definition: partial_shape.hpp:46
virtual void wait_for_read_ready()
check tensor for new data, call may block. backends may use this to ensure tensor is updated (eg: laz...
Definition: tensor.hpp:89
virtual void read(void *p, size_t n) const =0
Read bytes directly from the tensor.
const std::string & get_name() const
Get tensor's unique name.
bool get_stale() const
Get the stale value of the tensor. A tensor is stale if its data is changed.
Definition: element_type.hpp:61
Shape for a tensor.
Definition: shape.hpp:31
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
virtual size_t get_element_count() const
Get number of elements in the tensor.
Definition: tensor.hpp:32
virtual size_t get_size_in_bytes() const
Get the size in bytes of the tensor.
virtual void write(const void *p, size_t n)=0
Write bytes directly into the tensor.
void set_stale(bool val)
Set the stale value of the tensor. A tensor is stale if its data is changed.
const ngraph::PartialShape & get_partial_shape() const
Get tensor partial shape.