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)
              logging.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(
                  [
                      len(ov.child_ops) <= 0
                      and len(ov.consuming_blocks) <= 0
                      for ov in [i, f, o, ci, co]
                  ]
              ):
                  expand_tf_lstm_block(op)
                  logging.info(
                      "Expanding {} (op_type: {})".format(
                          op.name, op.op_type
                      )
                  )
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/ssa_passes/expand_tf_lstm.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
  from coremltools.converters.mil.mil import types
  import numpy
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: expand_tf_lstm_helper(block) without return types