namespace ngraph::op::util

Overview

namespace util {

// namespaces

namespace ngraph::op::util::detail;
namespace ngraph::op::util::error;

// typedefs

typedef ov::op::util::MultiSubGraphOp::InputDescription::Ptr MultiSubgraphInputDescriptionPtr;
typedef ov::op::util::MultiSubGraphOp::OutputDescription::Ptr MultiSubgraphOutputDescriptionPtr;
typedef util::MultiSubGraphOp::MultiSubgraphInputDescriptionVector MultiSubgraphInputDescriptionVector;
typedef util::MultiSubGraphOp::MultiSubgraphOutputDescriptionVector MultiSubgraphOutputDescriptionVector;
typedef util::SubGraphOp::InputDescription::Ptr InputDescriptionPtr;
typedef util::SubGraphOp::OutputDescription::Ptr OutputDescriptionPtr;
typedef std::vector<InputDescriptionPtr> InputDescriptionVector;
typedef std::vector<OutputDescriptionPtr> OutputDescriptionVector;

// global functions

template <class T>
bool normalize_single_value(
    std::vector<T> vec,
    float& value
    );

template <class T>
bool has_op_with_type(const std::shared_ptr<const ngraph::Function>& function);

bool has_decompression_converts(const std::shared_ptr<const ngraph::Function>& function);
std::string create_ie_output_name(const ngraph::Output<const ngraph::Node>& output);
std::string create_ie_output_name(const ngraph::Output<ngraph::Node>& output);
std::string get_ie_output_name(const ngraph::Output<const ngraph::Node>& output);
std::string get_ie_output_name(const ngraph::Output<ngraph::Node>& output);

template <typename T>
bool has_constant_value(
    const std::shared_ptr<Node>& node,
    const T value,
    T epsilon = std::numeric_limits<T>::epsilon()
    );

template <typename T>
bool has_constant_value(
    const std::shared_ptr<Node>& node,
    const std::vector<T> values,
    T epsilon = std::numeric_limits<T>::epsilon()
    );

bool get_single_value(
    const std::shared_ptr<op::Constant>& const_node,
    float& value
    );

std::shared_ptr<ngraph::Node> normalize_constant(
    const std::shared_ptr<op::Constant>& constant,
    const PartialShape& shape
    );

std::shared_ptr<ngraph::Node> broadcastTo(
    const Output<Node>& input,
    const Shape& shape
    );

std::shared_ptr<ngraph::Node> reshapeTo(
    const Output<Node>& input,
    const Shape& shape
    );

bool constantIsEqualTo(
    const std::shared_ptr<ngraph::op::Constant>& const_node,
    float value,
    float eps = 1e-5
    );

bool has_f16_constants(const std::shared_ptr<const ngraph::Function>& function);

bool check_for_broadcast(
    const ngraph::PartialShape& ref_shape,
    const ngraph::PartialShape& other_shape
    );

std::shared_ptr<ngraph::Node> activation(
    const std::string& activation_name,
    const ngraph::Output<ngraph::Node>& apply_to
    );

bool is_seq_len_provided(
    const std::shared_ptr<Node>& seq_len_input,
    int64_t max_seq_len
    );

std::shared_ptr<Node> try_fold_unary_output(const std::shared_ptr<Node>& node);

std::shared_ptr<Node> clone_try_fold(
    const std::shared_ptr<Node>& node,
    const OutputVector& inputs
    );

bool shapes_equal_except_dynamic_expected_batch(
    const ngraph::PartialShape& expected,
    const ngraph::PartialShape& actual
    );

void visit_shape_path(
    ov::Node \* node,
    std::unordered_set<ov::Node \*>& visited,
    std::function<void(ov::Node \*)> func
    );

template <typename T, typename... Args>
std::shared_ptr<Node> make_try_fold(Args&&... args);

template <class T>
Output<Node> eltwise_fold(
    const Output<Node>& input0,
    const Output<Node>& input1
    );

std::vector<Input<Node>> get_node_target_inputs(const std::shared_ptr<Node>& node);

std::shared_ptr<ngraph::Node> node_to_get_shape_value_of_indices_from_shape_node(
    const std::shared_ptr<ngraph::Node>& shape_node,
    const std::vector<size_t>& indices
    );

std::shared_ptr<ngraph::Node> node_to_get_shape_value_of_indices_from_shape_source(
    const ngraph::Output<ngraph::Node>& shape_source,
    const std::vector<size_t>& indices
    );

bool is_dequantization_subgraph(const Output<Node>& node);

bool can_eliminate_eltwise_node(
    const std::shared_ptr<Node>& eltwise,
    const Output<Node>& constant,
    const Output<Node>& non_constant_input
    );

struct NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon");
void validate_seq_input_rank_dimension(const std::vector<ngraph::PartialShape>& input);

} // namespace util

Detailed Documentation

Global Functions

struct NGRAPH_DEPRECATED("It is obsolete structure and will be removed soon")

Base class for annotations added to graph ops.

void validate_seq_input_rank_dimension(const std::vector<ngraph::PartialShape>& input)

Validates static rank and dimension for provided input parameters. Additionally input_size dimension is checked for X and W inputs. Applies to LSTM, GRU and RNN Sequences.

Parameters:

input

Vector with RNNSequence-like op inputs in following order: X, initial_hidden_state, sequence_lengths, W, R and B.