namespace ov::op::util¶
Overview¶
namespace util {
// namespaces
namespace ov::op::util::detail;
namespace ov::op::util::error;
namespace ov::op::util::rfft_common_validation;
// typedefs
typedef std::shared_ptr<Node>(\*)(const std::shared_ptr<Node>&, float, float) ActivationFunctionType;
typedef std::vector<util::SubGraphOp::InputDescription::Ptr> InputDescriptionVector;
typedef std::vector<util::SubGraphOp::OutputDescription::Ptr> OutputDescriptionVector;
typedef std::vector<Variable::Ptr> VariableVector;
typedef std::unordered_map<Variable::Ptr, VariableValue::Ptr> VariableMap;
// enums
enum LSTMPeepholesFormat;
enum LSTMWeightsFormat;
// structs
struct VariableInfo;
// classes
class ActivationFunction;
class ArithmeticReduction;
class ArithmeticReductionKeepDims;
class AssignBase;
class BinaryElementwiseArithmetic;
class BinaryElementwiseComparison;
class BinaryElementwiseLogical;
class BroadcastBase;
class ConvertColorI420Base;
class ConvertColorNV12Base;
class DeformableConvolutionBase;
class DetectionOutputBase;
class EmbeddingBagOffsetsBase;
class EmbeddingBagPackedBase;
class FFTBase;
class FrameworkNode;
class FrameworkNodeAttrs;
class GatherBase;
class GatherNDBase;
class IndexReduction;
class LogicalReduction;
class LogicalReductionKeepDims;
class MaxPoolBase;
class MultiSubGraphOp;
class MulticlassNmsBase;
class RNNCellBase;
class ReadValueBase;
class ReductionBase;
class ScatterBase;
class ScatterNDBase;
class SubGraphOp;
class UnaryElementwiseArithmetic;
class Variable;
class VariableContext;
class VariableExtension;
class VariableValue;
// global functions
ActivationFunction get_activation_func_by_name(const std::string& func_name);
std::tuple<element::Type, PartialShape> validate_and_infer_elementwise_args(
Node \* node,
const op::AutoBroadcastSpec& autob = op::AutoBroadcastSpec()
);
OPENVINO_API bool is_unary_elementwise_arithmetic(const Node \* node);
OPENVINO_API bool is_binary_elementwise_arithmetic(const Node \* node);
OPENVINO_API bool is_binary_elementwise_comparison(const Node \* node);
OPENVINO_API bool is_binary_elementwise_logical(const Node \* node);
OPENVINO_API bool supports_auto_broadcast(const Node \* node);
OPENVINO_API bool is_op(const Node \* node);
OPENVINO_API bool is_parameter(const Node \* node);
OPENVINO_API bool is_output(const Node \* node);
OPENVINO_API bool is_sink(const Node \* node);
OPENVINO_API bool is_constant(const Node \* node);
OPENVINO_API bool is_commutative(const Node \* node);
OPENVINO_API bool is_unary_elementwise_arithmetic(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_binary_elementwise_arithmetic(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_binary_elementwise_comparison(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_binary_elementwise_logical(const std::shared_ptr<Node>& node);
OPENVINO_API bool supports_auto_broadcast(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_op(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_parameter(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_output(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_sink(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_constant(const std::shared_ptr<Node>& node);
OPENVINO_API bool is_commutative(const std::shared_ptr<Node>& node);
std::shared_ptr<Node> OPENVINO_API convert_lstm_node_format(
const Output<Node>& node,
LSTMWeightsFormat from_format,
LSTMWeightsFormat to_format = LSTMWeightsFormat::FICO,
int64_t axis = 0
);
std::shared_ptr<Node> OPENVINO_API convert_lstm_peepholes_format(
const Output<Node>& node,
LSTMPeepholesFormat from_format,
LSTMPeepholesFormat to_format = LSTMPeepholesFormat::FIO,
int64_t axis = 0
);
template <typename T>
void validate_target_shape_none(
const ov::Node \* op,
const T& arg_shape,
const AxisVector& axes_mapping_val,
const T& target_shape
);
template <typename T>
void validate_target_shape_numpy(
const ov::Node \* op,
const T& arg_shape,
const T& target_shape
);
template <typename T>
void set_result_shape_pdpd(
const ov::Node \* op,
const T& arg0_shape,
const T& target_shape,
T& result_shape,
const ov::op::BroadcastModeSpec& broadcast_spec
);
template <typename T>
void set_result_shape_bidirectional(
const ov::Node \* op,
const T& arg_shape,
T& target_shape,
T& result_shape
);
template <class T>
void broadcase_base_shape_infer(
const ov::op::util::BroadcastBase \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
const std::map<size_t, std::shared_ptr<ngraph::runtime::HostTensor>>& constant_data = {}
);
template <
typename T,
typename V = typename std::iterator_traits<typename T::iterator>::value_type::value_type
>
void compute_num_classes(
const DetectionOutputBase \* op,
const DetectionOutputBase::AttributesBase& attrs,
const std::vector<T>& input_shapes,
V& num_classes,
V& num_prior_boxes
);
template <class T>
void shape_infer_base(
const DetectionOutputBase \* op,
const DetectionOutputBase::AttributesBase& attrs,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
int64_t attribute_num_classes
);
template <class T>
void shape_infer(
const ov::op::util::EmbeddingBagOffsetsBase \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes
);
template <class T>
void check_1D_or_scalar_shape(
const ov::op::v9::Eye \* op,
const T& input_shape,
const std::string name
);
template <class T>
void shape_infer(
const ov::op::util::FFTBase \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
const std::map<size_t, std::shared_ptr<ngraph::runtime::HostTensor>>& constant_data = {}
);
template <class T>
void shape_infer(
const GatherBase \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
const std::map<size_t, std::shared_ptr<ngraph::runtime::HostTensor>>& constant_data = {}
);
template <class T>
void irdft_shape_infer(
const ov::op::v9::IRDFT \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
const std::map<size_t, std::shared_ptr<ngraph::runtime::HostTensor>>& constant_data = {}
);
template <class T>
void shape_infer(
const ov::op::util::MulticlassNmsBase \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
bool static_output = false,
bool ignore_bg_class = false
);
template <typename B>
B get_ouput_dimension_bound(B b);
template <class DimType>
DimType get_rdft_output_dimension(DimType d);
template <class T>
void rdft_shape_infer(
const ov::op::v9::RDFT \* op,
const std::vector<T>& input_shapes,
std::vector<T>& output_shapes,
const std::map<size_t, std::shared_ptr<ngraph::runtime::HostTensor>>& constant_data = {}
);
} // namespace util
Detailed Documentation¶
Global Functions¶
ActivationFunction get_activation_func_by_name(const std::string& func_name)
Gets the activation function by name.
Parameters:
func_name |
The function name |
UnknownActivationFunction |
When provided func_name is unknown. |
Returns:
The activation function object.
std::shared_ptr<Node> OPENVINO_API convert_lstm_node_format(
const Output<Node>& node,
LSTMWeightsFormat from_format,
LSTMWeightsFormat to_format = LSTMWeightsFormat::FICO,
int64_t axis = 0
)
Change data format of provided node.
Parameters:
node |
The input node to be permuted. |
from_format |
Original node weights format. |
to_format |
Weights format to convert to. |
Returns:
Node representing reshaped tensor according to to_format
weights format.