Class InferenceEngine::Data

class Data

This class represents the main Data representation node.

Deprecated:

The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html

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

Public Functions

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

An empty constructor (dimensionless)

Parameters
  • name – Name of the data node

  • _precisionPrecision of the data

  • layoutData 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

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

precisionPrecision 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