Class ov::pass::pattern::op::Optional

class Optional : public ov::pass::pattern::op::Pattern

A submatch on the graph value which contains optional op types defined in constructor. The match is succeed in case of full graphs matching or extended by one of optional type graph or pattern. Otherwise fails. Important note: graph can include only one optional op in the end of graph vs pattern. Optional op can contain only 1 in and 1 out

Public Functions

inline Optional(const std::vector<DiscreteTypeInfo> &type_infos, const Output<Node> &pattern, const pattern::op::ValuePredicate &pred = [](const Output< Node > &output) { return true;})

creates an optional node matching one pattern. Add nodes to match list.

Parameters
  • type_infosOptional operation types to exclude them from the matching in case the following op types do not exist in a pattern to match.

  • patterns – The pattern to match a graph.