class ngraph::runtime::Tensor

Overview

#include <tensor.hpp>

class Tensor
{
public:
    // methods

    Tensor& operator = (const Tensor&);
    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;
    const std::string& get_name() const;
    virtual void write(const void \* p, size_t n) = 0;
    virtual void read(void \* p, size_t n) const = 0;
};

// direct descendants

class HostTensor;

Detailed Documentation

Methods

virtual const ngraph::Shape& get_shape() const

Get tensor shape.

Returns:

const reference to a Shape

const ngraph::PartialShape& get_partial_shape() const

Get tensor partial shape.

Returns:

const reference to a PartialShape

virtual const element::Type& get_element_type() const

Get tensor element type.

Returns:

element::Type

virtual size_t get_element_count() const

Get number of elements in the tensor.

Returns:

number of elements in the tensor

virtual size_t get_size_in_bytes() const

Get the size in bytes of the tensor.

Returns:

number of bytes in tensor’s allocation

const std::string& get_name() const

Get tensor’s unique name.

Returns:

tensor’s name

virtual void write(const void \* p, size_t n) = 0

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 = 0

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.