class_docstr: A graph optimization pass on PyMIL to detect and fuse several variants of ``layer_norm`` or
  ``instance_norm``. Pattern 1 corresponds to either ``layer_norm`` or ``instance_norm``. Patterns 2-4
  are ``instance_norm``. Pattern 5 is ``layer_norm``. You can find these patterns in the methods for
  this class in the source code. To quickly view the source code, click the **[source]** button at
  the end of the class definition.
docstr: Returns child op if type matches, otherwise returns ``None``.
  
          Parameters
          ----------
  
  param op : Current op.
  
  param child_op_type : Expected child op type.
  
  param index : Child op index.
docstr_tok: ["Returns","child","op","if","type","matches",",","otherwise","returns","``","None","``",".","Parameters","--","--","--","--","--","param","op",":","Current","op",".","param","child_op_type",":","Expected","child","op","type",".","param","index",":","Child","op","index","."]
code: def _try_get_child_op_type(
      op: Operation, child_op_type: str, index: int = 0
  ) -> Optional[Operation]:
      """
      Returns child op if type matches, otherwise returns ``None``.
  
              Parameters
              ----------
  
      param op : Current op.
  
      param child_op_type : Expected child op type.
  
      param index : Child op index.
      """
      if op is None:
          return None
      if len(op.outputs) != 1:
          return None
      child_ops = list(op.outputs[0].child_ops)
      if index >= len(child_ops):
          return None
      if child_ops[index].op_type != child_op_type:
          return None
      return child_ops[index]
  
imports: from typing import List, Optional
  import numpy
  from coremltools import _logger
  from coremltools.converters.mil.mil import Block
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Operation, Program, Var
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import _check_no_output_connection, block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 4 for calling the fuse_layernorm_or_instancenorm obj's underlying member method code with example usage: obj._try_get_child_op_type(op, child_op_type, index) and returns: child_ops, None, None, None, None