code: def fuse_onehot_matmul_to_gather_block(block):
      fusion_status = False
      for i, op in enumerate(list(block.operations)):
          for b in op.blocks:
              block_changed = True
              while block_changed:
                  block_changed = fuse_onehot_matmul_to_gather_block(b)
          if len(op.blocks) > 0:
              # This op can't be pow
              continue
  
          # start pattern match if one_hot op is encountered
          if op.op_type == "one_hot":
              with block:
                  fusion_status = try_to_transform(op, block)
              # has to break as the downstream iterator is affected.
              if fusion_status:
                  return fusion_status
      return fusion_status
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/mil/passes/onehot_matmul_to_gather.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
  from coremltools.converters.mil.mil import Builder
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: fuse_onehot_matmul_to_gather_block(block) and returns: fusion_status, fusion_status