class ov::op::util::VariableValue

Overview

VariableValue stores data and state (reset flag) for a Variable, and provides an interface for changing them. More…

#include <variable_value.hpp>

class VariableValue
{
public:
    // typedefs

    typedef std::shared_ptr<VariableValue> Ptr;

    // construction

    VariableValue();
    VariableValue(ngraph::HostTensorPtr value);
    VariableValue(ngraph::HostTensorPtr value, bool reset);
    VariableValue(const ov::Tensor& value);
    VariableValue(const ov::Tensor& value, bool reset);

    // methods

    ngraph::HostTensorPtr get_value() const;
    void set_value(const ngraph::HostTensorPtr& value);
    void set_reset(bool reset);
    bool get_reset() const;
    const ov::Tensor& get_state() const;
    void set_state(const ov::Tensor& value);
};

Detailed Documentation

VariableValue stores data and state (reset flag) for a Variable, and provides an interface for changing them.

Construction

VariableValue()

Constructs an uninitialized VariableValue.

VariableValue(ngraph::HostTensorPtr value)

Constructor for VariableValue.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

Parameters:

value

The data for Variable.

VariableValue(ngraph::HostTensorPtr value, bool reset)

Constructor for VariableValue.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

Parameters:

value

Data for Variable.

reset

The current state of the reset flag.

VariableValue(const ov::Tensor& value, bool reset)

Constructor for VariableValue.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

Parameters:

value

Data for Variable.

reset

The current state of the reset flag.

Methods

ngraph::HostTensorPtr get_value() const

Returns the current stored data.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

void set_value(const ngraph::HostTensorPtr& value)

Sets new values for Variable.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

Parameters:

value

New data for Variable.

void set_reset(bool reset)

Sets the reset flag to a new state.

Parameters:

reset

The new state of the reset flag.

bool get_reset() const

Returns the current reset flag state.

const ov::Tensor& get_state() const

Returns the current stored data.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

void set_state(const ov::Tensor& value)

Sets new values for Variable.

Deprecated This method is deprecated and will be removed in 2024.0 release. Please use method with ov::Tensor instead

Parameters:

value

New data for Variable.