docstr: Inference with TF-Lite compatibility. It assumes
  batch_size is 1
docstr_tok: ["Inference","with","TF-Lite","compatibility",".","It","assumes","batch_size","is","1"]
code: def decode_inference_tflite(self, memory, states):
      """Inference with TF-Lite compatibility. It assumes
      batch_size is 1"""
      # init states
      # dynamic_shape is not supported in TFLite
      outputs = tf.TensorArray(
          dtype=tf.float32,
          size=self.max_decoder_steps,
          element_shape=tf.TensorShape([self.output_dim]),
          clear_after_read=False,
          dynamic_size=False,
      )
      # stop_flags = tf.TensorArray(dtype=tf.bool,
      #                          size=self.max_decoder_steps,
      #                          element_shape=tf.TensorShape(
      #                              []),
      #                          clear_after_read=False,
      #                          dynamic_size=False)
      attentions = ()
      stop_tokens = ()
  
      # pre-computes
      self.attention.process_values(memory)
  
      # iter vars
      stop_flag = tf.constant(False, dtype=tf.bool)
      step_count = tf.constant(0, dtype=tf.int32)
  
      def _body(step, memory, states, outputs, stop_flag):
          frame_next = states[0]
          prenet_next = self.prenet(frame_next, training=False)
          output, stop_token, states, _ = self.step(
              prenet_next, states, None, training=False
          )
          stop_token = tf.math.sigmoid(stop_token)
          stop_flag = tf.greater(stop_token, self.stop_thresh)
          stop_flag = tf.reduce_all(stop_flag)
          # stop_flags = stop_flags.write(step, tf.logical_not(stop_flag))
  
          outputs = outputs.write(step, tf.reshape(output, [-1]))
          return step + 1, memory, states, outputs, stop_flag
  
      cond = lambda step, m, s, o, stop_flag: tf.equal(
          stop_flag, tf.constant(False, dtype=tf.bool)
      )
      step_count, memory, states, outputs, stop_flag = tf.while_loop(
          cond,
          _body,
          loop_vars=(step_count, memory, states, outputs, stop_flag),
          parallel_iterations=32,
          swap_memory=True,
          maximum_iterations=self.max_decoder_steps,
      )
  
      outputs = outputs.stack()
      outputs = tf.gather(
          outputs, tf.range(step_count)
      )  # pylint: disable=no-value-for-parameter
      outputs = tf.expand_dims(outputs, axis=[0])
      outputs = tf.transpose(outputs, [1, 0, 2])
      outputs = tf.reshape(outputs, [1, -1, self.frame_dim])
      return outputs, stop_tokens, attentions
  
imports: import tensorflow
  from tensorflow import keras
  from TTS.tts.tf.utils.tf_utils import shape_list
  from TTS.tts.tf.layers.common_layers import Prenet, Attention
label_desc: Use image node_id 8 for calling the Decoder obj's underlying member method code with example usage: obj.decode_inference_tflite(memory, states) and returns: outputs,  stop_tokens,  attentions, unknown,  memory,  states,  outputs,  stop_flag