class InferenceEngine::Data

Overview

This class represents the main Data representation node. More…

#include <ie_data.h>

class Data
{
public:
    // construction

    Data(const std::string& name, Precision _precision, Layout layout = NCHW);
    Data(const std::string& name, const TensorDesc& desc);
    Data(const Data& data);

    // methods

    Data& operator = (const Data& data);
    bool isInitialized() const;
    void setDims(const SizeVector& a_dims);
    void setLayout(Layout layout);
    void reshape(const SizeVector& dims, Layout layout);
    void reshape(const std::initializer_list<size_t>& dims, Layout layout);
    Layout getLayout() const;
    const TensorDesc& getTensorDesc() const;
    const Precision& getPrecision() const;
    void setPrecision(const Precision& precision);
    const SizeVector& getDims() const;
    const std::string& getName() const;
    void setName(const std::string& newName);
    const UserValue& getUserObject() const;
};

Detailed Documentation

This class represents the main Data representation node.

The NN graphs are di-graphs consisting of data nodes and layer nodes.

Construction

Data(const std::string& name, Precision _precision, Layout layout = NCHW)

An empty constructor (dimensionless)

Parameters:

name

Name of the data node

_precision

Precision of the data

layout

Data layout

Data(const std::string& name, const TensorDesc& desc)

A constructor with tensor descriptor.

Parameters:

name

Name of the data node

desc

Tensor descriptor

Data(const Data& data)

A copy constructor.

Parameters:

data

A data object to copy from

Methods

Data& operator = (const Data& data)

An assignment operator.

Parameters:

data

A data object to copy from

Returns:

An assigned object

bool isInitialized() const

Checks if the current node is resolved.

Returns:

true if resolved, false otherwise.

void setDims(const SizeVector& a_dims)

Sets the data dimensions.

After the current node is marked as resolved.

Parameters:

a_dims

Tensor dimensions to set

void setLayout(Layout layout)

Sets the layout value for this Data instance.

Parameters:

layout

Layout value to set

void reshape(const SizeVector& dims, Layout layout)

changes dims and layout at same time

Parameters:

dims

new dimensions

layout

new layout

void reshape(const std::initializer_list<size_t>& dims, Layout layout)

changes dims and layout at same time

Deprecated Use InferenceEngine::Data::reshape(const SizeVector&, Layout)

Parameters:

dims

new dimensions

layout

new layout

Layout getLayout() const

Gets the layout value for this Data instance.

Returns:

Layout

const TensorDesc& getTensorDesc() const

Gets Tensor descriptor reference.

Returns:

reference to TensorDesc

const Precision& getPrecision() const

Gets a precision type of this Data instance.

Returns:

Precision type

void setPrecision(const Precision& precision)

Sets a precision type of this Data instance.

Parameters:

precision

Precision of the data

const SizeVector& getDims() const

Returns:

data dimensions

const std::string& getName() const

Returns:

name of the data object

void setName(const std::string& newName)

Sets a name the Data object.

Parameters:

newName

Name of the data node

const UserValue& getUserObject() const

Returns:

convenient arbitrary user data holder