Class ov::op::v8::If

class If : public ov::op::util::MultiSubGraphOp

If operation.

Public Functions

If(const Output<Node> &execution_condition)

Constructs If with condition.

Parameters

execution_condition – condition node.

inline const std::shared_ptr<Model> &get_then_body() const

gets then_body as ov::Model.

Returns

then_body as ov::Model.

inline const std::shared_ptr<Model> &get_else_body() const

gets else_body as ov::Model.

Returns

else_body as ov::Model.

inline void set_then_body(const std::shared_ptr<Model> &body)

sets new ov::Model as new then_body.

Parameters

body – new body for ‘then’ branch.

inline void set_else_body(const std::shared_ptr<Model> &body)

sets new ov::Model as new else_body.

Parameters

body – new body for ‘else’ branch.

void set_input(const Output<Node> &value, const std::shared_ptr<v0::Parameter> &then_parameter, const std::shared_ptr<v0::Parameter> &else_parameter)

sets new input to the operation associated with parameters of each sub-graphs

Parameters
  • value – input to operation

  • then_parameter – parameter for then_body or nullptr

  • else_parameter – parameter for else_body or nullpt

Output<Node> set_output(const std::shared_ptr<v0::Result> &then_result, const std::shared_ptr<v0::Result> &else_result)

sets new output from the operation associated with results of each sub-graphs

Parameters
  • then_result – result from then_body

  • else_parameter – result from else_body

Returns

output from operation

virtual void validate_and_infer_types() override

Verifies that attributes and inputs are consistent and computes output shapes and element types. Must be implemented by concrete child classes so that it can be run any number of times.

Throws if the node is invalid.