Class ngraph::runtime::HostTensor

class HostTensor : public ngraph::runtime::Tensor

Public Functions

virtual void write(const void *p, size_t n) override

Write bytes directly into the tensor.

Parameters
  • p – Pointer to source of data

  • n – Number of bytes to write, must be integral number of elements.

virtual void read(void *p, size_t n) const override

Read bytes directly from the tensor.

Parameters
  • p – Pointer to destination for data

  • n – Number of bytes to read, must be integral number of elements.

void set_element_type(const element::Type &element_type)

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

Parameters

element_type – The element type

void set_shape(const Shape &shape)

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

Parameters

shape – The shape being set

void set_unary(const HostTensorPtr &arg)

Set the shape of a node from an input.

Parameters

arg – The input argument

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

Set the shape of the tensor using broadcast rules.

Parameters
  • autob – The broadcast mode

  • arg0 – The first argument

  • arg1 – The second argument

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.

Parameters
  • autob – The broadcast mode

  • arg0 – The first argument

  • arg1 – The second argument

  • element_type – The output element type