class ngraph::op::TypeRelaxed

Overview

Relaxes tensor element type requirements for BaseOp inputs and outputs This class template should be used with Node descendant class. More…

#include <type_relaxed.hpp>

template <typename BaseOp>
class TypeRelaxed:
    public BaseOp,
    public ngraph::op::TypeRelaxedBase
{
public:
    // construction

    TypeRelaxed();
    TypeRelaxed(const BaseOp& base_op, element::Type overridden_type);

    TypeRelaxed(
        const BaseOp& base_op,
        const element::TypeVector& _input_data_types = {},
        const element::TypeVector& _output_data_types = {}
        );

    template <typename... Args>
    TypeRelaxed(
        const element::TypeVector& _input_data_types,
        const element::TypeVector& _output_data_types,
        Args&&... args
        );

    // methods

    void validate_and_infer_types();

    OPENVINO_SUPPRESS_DEPRECATED_START bool evaluate(
        const HostTensorVector& outputs,
        const HostTensorVector& inputs
        ) const;

    OPENVINO_SUPPRESS_DEPRECATED_END std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const;
    bool visit_attributes(AttributeVisitor& visitor);
};

Inherited Members

public:
    // structs

    struct init_rt_result;

    // methods

    const element::Type& get_overridden_output_type(size_t outputIndex = 0) const;

    void set_overridden_output_type(
        const element::Type& element_type,
        size_t outputIndex = 0
        );

    const element::Type& get_origin_input_type(size_t inputIndex = 0) const;

    void set_origin_input_type(
        const element::Type& element_type,
        size_t inputIndex = 0
        );

Detailed Documentation

Relaxes tensor element type requirements for BaseOp inputs and outputs This class template should be used with Node descendant class. Defines a new operation by extending the original BaseOp operation with ability to accept inputs and provide outputs with element type that is unusual for BaseOp. For example, TypeRelaxed<opset1::Add> can accept mixed-precision inputs and provide another type of output. New types are provided as inputs attributes for TypeRelaxed template and fixed. There is no any deduction logic for types are provided as a part of this class and it should be implemented outside if required.

Construction

template <typename... Args>
TypeRelaxed(
    const element::TypeVector& _input_data_types,
    const element::TypeVector& _output_data_types,
    Args&&... args
    )

Creating a new TypeRelaxed operation by calling one of the original op ctors forwarding arguments directly.