code: def _expand_tf_lstm_helper(block):
      # shallow copy hides changes on f.operations during the loop
      for op in block.operations[:]:
          for b in op.blocks:
              _expand_tf_lstm_helper(b)
  
          if op.op_type == "tf_lstm_block_cell":
              _expand_tf_lstm_block_cell(op)
              logger.info(
                  "Expanding {} (op_type: {})".format(
                      op.name, op.op_type
                  )
              )
  
          if op.op_type == "tf_lstm_block":
              # only cs, h are supported for now. Can be easily extended to other outputs at performance hit.
              i, cs, f, o, ci, co, h = op.outputs
              if all(
                  map(
                      lambda x: len(x.child_ops) == 0
                      and len(x.consuming_blocks) == 0,
                      (i, f, o, ci, co),
                  )
              ):
                  _expand_tf_lstm_block(op)
                  logger.info(
                      "Expanding {} (op_type: {})".format(
                          op.name, op.op_type
                      )
                  )
  
file_path: coremltools/coremltools/converters/mil/frontend/tensorflow/ssa_passes/expand_tf_lstm.py
imports: import numpy
  from coremltools import _logger
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 1 for calling a global function with example usage: _expand_tf_lstm_helper(block) without return types