class_docstr: A tree pattern that matches TF expressions with certain op types.
docstr: Initializes an OpTypePattern.
  
  Args:
    op_type: string that specifies the allowed types of the root. It can be
      (1) an op type, e.g. 'Conv2D',
      (2) '*', i.e. wildcard, or
      (3) multiple op types separated by '|', e.g., 'Relu|Relu6'.
      We could use regex strings, which might be worthwhile when we have many
      similar TF op types.
    name: Optional string. The name of the pattern that can be looked up in
      MatchResult.
    inputs: Optional list of `Pattern`s or strings that specify the
      patterns for the inputs of a matching op. If None, this pattern accepts
      any inputs of a matching op.
    ordered_inputs: Defaults to True. If False, will match any op that
      matches a permutation of the inputs.
  
  Raises:
    ValueError: if too many inputs are provided when order_inputs is False.
docstr_tok: ["Initializes","an","OpTypePattern",".","Args",":","op_type",":","string","that","specifies","the","allowed","types","of","the","root",".","It","can","be","(","1",")","an","op","type",",","e.g",".","'Conv2D","'",",","(","2",")","'","*","'",",","i.e",".","wildcard",",","or","(","3",")","multiple","op","types","separated","by","'|","'",",","e.g.",",","'Relu|Relu6","'",".","We","could","use","regex","strings",",","which","might","be","worthwhile","when","we","have","many","similar","TF","op","types",".","name",":","Optional","string",".","The","name","of","the","pattern","that","can","be","looked","up","in","MatchResult",".","inputs",":","Optional","list","of","`","Pattern","`","s","or","strings","that","specify","the","patterns","for","the","inputs","of","a","matching","op",".","If","None",",","this","pattern","accepts","any","inputs","of","a","matching","op",".","ordered_inputs",":","Defaults","to","True",".","If","False",",","will","match","any","op","that","matches","a","permutation","of","the","inputs",".","Raises",":","ValueError",":","if","too","many","inputs","are","provided","when","order_inputs","is","False","."]
code: def __init__(
      self, op_type, name=None, inputs=None, ordered_inputs=True
  ):
      """Initializes an OpTypePattern.
  
      Args:
        op_type: string that specifies the allowed types of the root. It can be
          (1) an op type, e.g. 'Conv2D',
          (2) '*', i.e. wildcard, or
          (3) multiple op types separated by '|', e.g., 'Relu|Relu6'.
          We could use regex strings, which might be worthwhile when we have many
          similar TF op types.
        name: Optional string. The name of the pattern that can be looked up in
          MatchResult.
        inputs: Optional list of `Pattern`s or strings that specify the
          patterns for the inputs of a matching op. If None, this pattern accepts
          any inputs of a matching op.
        ordered_inputs: Defaults to True. If False, will match any op that
          matches a permutation of the inputs.
  
      Raises:
        ValueError: if too many inputs are provided when order_inputs is False.
      """
      self._op_type = op_type
      self._name = name
      if inputs is None:
          inputs = []
      if len(inputs) > 8:
          raise ValueError(
              "Only < 8 inputs are allowed when ordered_inputs is False."
          )
      self._inputs = [
          input_pattern
          if isinstance(input_pattern, Pattern)
          else OpTypePattern(input_pattern)
          for input_pattern in inputs
      ]
      self._ordered_inputs = ordered_inputs
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import itertools
  from mmdnn.conversion.common.DataStructure.graph import Graph
label_desc: Use image node_id 1 to create a new OpTypePattern object from inherited base classes: Pattern with example: obj = OpTypePattern(op_type, name, inputs, ordered_inputs)