class ngraph::runtime::HostTensor

Overview

#include <host_tensor.hpp>

class HostTensor: public ngraph::runtime::Tensor
{
public:
    // construction

    HostTensor(, , );
    HostTensor(, );
    HostTensor(, );
    HostTensor();
    HostTensor();
    HostTensor();

    // methods

    voidconst std::shared_ptr<op::v0::Constant>& initialize();
    void \* get_data_ptr();
    const void \* get_data_ptr() const;

    template <>
    T \* get_data_ptr();

    template <>
    const T \* get_data_ptr() const;

    template <>
    element_type_traits<ET>::value_type \* get_data_ptr();

    template <>
    const element_type_traits<ET>::value_type \* get_data_ptr() const;

    virtual voidconst void \*size_t write(, );
    virtual voidvoid \*size_t read(, ) const;
    bool get_is_allocated() const;
    voidconst element::Type& set_element_type();
    voidconst Shape& set_shape();
    voidconst HostTensorPtr& set_unary();

    voidconst op::AutoBroadcastSpec&const HostTensorPtr&const HostTensorPtr& set_broadcast(
        ,
        ,

        );

    voidconst op::AutoBroadcastSpec&const HostTensorPtr&const HostTensorPtr&const element::Type& set_broadcast(
        ,
        ,
        ,

        );
};

Inherited Members

public:
    // methods

    Tensor&const Tensor& operator = ();
    virtual const ngraph::Shape& get_shape() const;
    const ngraph::PartialShape& get_partial_shape() const;
    virtual const element::Type& get_element_type() const;
    virtual size_t get_element_count() const;
    virtual size_t get_size_in_bytes() const;
    virtual voidconst void \*size_t write(, ) = 0;
    virtual voidvoid \*size_t read(, ) const = 0;

Detailed Documentation

Methods

virtual voidconst void \*size_t write(, )

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 voidvoid \*size_t read(, ) const

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.

voidconst element::Type& set_element_type()

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

Parameters:

element_type

The element type

voidconst Shape& set_shape()

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

Parameters:

shape

The shape being set

voidconst HostTensorPtr& set_unary()

Set the shape of a node from an input.

Parameters:

arg

The input argument

voidconst op::AutoBroadcastSpec&const HostTensorPtr&const HostTensorPtr& set_broadcast(
    ,
    ,

    )

Set the shape of the tensor using broadcast rules.

Parameters:

autob

The broadcast mode

arg0

The first argument

arg1

The second argument

voidconst op::AutoBroadcastSpec&const HostTensorPtr&const HostTensorPtr&const element::Type& set_broadcast(
    ,
    ,
    ,

    )

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