code: def tf_lstm_to_core_lstm(prog):
      """
      Try to map TF dialect ops `tf_lstm_block` and `tf_lstm_block_cell` to
      `lstm` in the core op set if compatible. They are compatible if all of the
      followings are satisfied:
  
      - If tf_lstm_block: only h output is consumed. tf_lstm_block has 7
        sequence outputs: [i, cs, f, o, ci, co, h]. Each of them (e.g., i) has
        shape [seq_len, batch, hidden_dim] (see tf_lstm_block op doc string).
        core lstm only supports sequence output for hidden state h, and thus if
        any outputs other than `h` is consumed, we cannot convert to lstm in the
        core op set.
  
      - If tf_lstm_block_cell: only cs, h output (outputs[1], outputs[6])
        are consumed. Similar to above.
  
      - batch size == 1 (due to bugs in core lstm backend impl rdar://62475041)
  
      Inputs:
  
          prog: Program
      """
      for f_name, f in prog.functions.items():
          tf_lstm_to_core_lstm_block(f)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/mil/frontend/tensorflow/ssa_passes/tf_lstm_to_core_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 1 for calling a global function with example usage: tf_lstm_to_core_lstm(prog) without return types