class_docstr: Fuse the following ``batch_norm`` layer into ``conv`` and ``conv_transpose``.
  That is, convert ``conv + batch_norm`` to ``conv``, by modifying the weight and bias in the ``conv`` layer.
  
  .. code-block::
  
      Given:
          %2 = conv(%1)
          ...
          %3 = batch_norm(%2)
          ...
  
      Result:
          %3 = conv(%1)
          ...
class_docstr_tok: ["Fuse","the","following","``","batch_norm","``","layer","into","``","conv","``","and","``","conv_transpose","``",".","That","is",",","convert","``","conv","+","batch_norm","``","to","``","conv","``",",","by","modifying","the","weight","and","bias","in","the","``","conv","``","layer",".","..","code-block",":",":","Given",":","%","2","=","conv","(","%","1",")","...","%","3","=","batch_norm","(","%","2",")","...","Result",":","%","3","=","conv","(","%","1",")","..."]
code: def _fuse_conv_batchnorm_block(self, block):
      def _match_pattern(op):
          if op.op_type == "conv" or op.op_type == "conv_transpose":
              # abort fusion if op output is also a block output
              if op.outputs[0] in op.enclosing_block.outputs:
                  return None
              # find batch_norm op
              child_ops = op.outputs[0].child_ops
              if len(child_ops) == 1:
                  bn_op_candidate = list(child_ops)[0]
                  if bn_op_candidate.op_type == "batch_norm":
                      return bn_op_candidate
          return None
  
      fusion_occurred = False
      for op in list(block.operations):
          for b in op.blocks:
              block_changed = True
              while block_changed:
                  block_changed = self._fuse_conv_batchnorm_block(b)
          if len(op.blocks) > 0:
              # This op can't be conv or conv_transpose
              continue
  
          bn_op = _match_pattern(op)
          if bn_op is not None:
              fusion_occurred = self._try_to_transform(op, bn_op)
              # has to break as the downstream iterator is affected.
              if fusion_occurred:
                  return fusion_occurred
      return fusion_occurred
  
imports: import copy
  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, types
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import _check_child_op_type, _check_no_output_connection, block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil.types.symbolic import any_symbolic
label_desc: Use image node_id 3 for calling the fuse_conv_batchnorm obj's underlying member method code with example usage: obj._fuse_conv_batchnorm_block(block) and returns: fusion_occurred, None, None, fusion_occurred, bn_op_candidate