code: def create_inference_graph(batch_size=1, n_steps=16, tflite=False):
      batch_size = batch_size if batch_size > 0 else None
  
      # Create feature computation graph
      input_samples = tfv1.placeholder(
          tf.float32, [Config.audio_window_samples], "input_samples"
      )
      samples = tf.expand_dims(input_samples, -1)
      mfccs, _ = audio_to_features(samples, FLAGS.audio_sample_rate)
      mfccs = tf.identity(mfccs, name="mfccs")
  
      # Input tensor will be of shape [batch_size, n_steps, 2*n_context+1, n_input]
      # This shape is read by the native_client in DS_CreateModel to know the
      # value of n_steps, n_context and n_input. Make sure you update the code
      # there if this shape is changed.
      input_tensor = tfv1.placeholder(
          tf.float32,
          [
              batch_size,
              n_steps if n_steps > 0 else None,
              2 * Config.n_context + 1,
              Config.n_input,
          ],
          name="input_node",
      )
      seq_length = tfv1.placeholder(
          tf.int32, [batch_size], name="input_lengths"
      )
  
      if batch_size <= 0:
          # no state management since n_step is expected to be dynamic too (see below)
          previous_state = None
      else:
          previous_state_c = tfv1.placeholder(
              tf.float32,
              [batch_size, Config.n_cell_dim],
              name="previous_state_c",
          )
          previous_state_h = tfv1.placeholder(
              tf.float32,
              [batch_size, Config.n_cell_dim],
              name="previous_state_h",
          )
  
          previous_state = tf.nn.rnn_cell.LSTMStateTuple(
              previous_state_c, previous_state_h
          )
  
      # One rate per layer
      no_dropout = [None] * 6
  
      if tflite:
          rnn_impl = rnn_impl_static_rnn
      else:
          rnn_impl = rnn_impl_lstmblockfusedcell
  
      logits, layers = create_model(
          batch_x=input_tensor,
          batch_size=batch_size,
          seq_length=seq_length if not FLAGS.export_tflite else None,
          dropout=no_dropout,
          previous_state=previous_state,
          overlap=False,
          rnn_impl=rnn_impl,
      )
  
      # TF Lite runtime will check that input dimensions are 1, 2 or 4
      # by default we get 3, the middle one being batch_size which is forced to
      # one on inference graph, so remove that dimension
      if tflite:
          logits = tf.squeeze(logits, [1])
  
      # Apply softmax for CTC decoder
      probs = tf.nn.softmax(logits, name="logits")
  
      if batch_size <= 0:
          if tflite:
              raise NotImplementedError(
                  "dynamic batch_size does not support tflite nor streaming"
              )
          if n_steps > 0:
              raise NotImplementedError(
                  "dynamic batch_size expect n_steps to be dynamic too"
              )
          return (
              {
                  "input": input_tensor,
                  "input_lengths": seq_length,
              },
              {
                  "outputs": probs,
              },
              layers,
          )
  
      new_state_c, new_state_h = layers["rnn_output_state"]
      new_state_c = tf.identity(new_state_c, name="new_state_c")
      new_state_h = tf.identity(new_state_h, name="new_state_h")
  
      inputs = {
          "input": input_tensor,
          "previous_state_c": previous_state_c,
          "previous_state_h": previous_state_h,
          "input_samples": input_samples,
      }
  
      if not FLAGS.export_tflite:
          inputs["input_lengths"] = seq_length
  
      outputs = {
          "outputs": probs,
          "new_state_c": new_state_c,
          "new_state_h": new_state_h,
          "mfccs": mfccs,
          # Expose internal layers for downstream applications
          "layer_3": layers["layer_3"],
          "layer_5": layers["layer_5"],
      }
  
      return inputs, outputs, layers
  
imports: from __future__ import absolute_import, division, print_function
  import os
  import sys
  import absl.app
  import numpy
  import progressbar
  import shutil
  import tensorflow
  import tensorflow.compat.v1
  import time
  from datetime import datetime
  from ds_ctcdecoder import ctc_beam_search_decoder, Scorer
  from .evaluate import evaluate
  from six.moves import zip, range
  from .util.config import Config, initialize_globals
  from .util.checkpoints import load_or_init_graph_for_training, load_graph_for_evaluation, reload_best_checkpoint
  from .util.evaluate_tools import save_samples_json
  from .util.feeding import create_dataset, audio_to_features, audiofile_to_features
  from .util.flags import create_flags, FLAGS
  from .util.helpers import check_ctcdecoder_version, ExceptionBox
  from .util.logging import create_progressbar, log_debug, log_error, log_info, log_progress, log_warn
  from .util.io import open_remote, remove_remote, listdir_remote, is_remote_path, isdir_remote
label_desc: Use image node_id 16 for calling a global function with example usage: create_inference_graph(batch_size, n_steps, tflite) and returns: inputs,  outputs,  layers, dict,  dict,  layers