code: def _decode_input_tensor_to_features_dict(
      feature_map, hparams, decode_hp
  ):
      """Convert the interactive input format (see above) to a dictionary.
  
      Args:
        feature_map: dict with inputs.
        hparams: model hyperparameters
        decode_hp: decode hyperparameters
  
      Returns:
        a features dictionary, as expected by the decoder.
      """
      inputs = tf.convert_to_tensor(feature_map["inputs"])
      input_is_image = False
  
      x = inputs
      p_hparams = hparams.problem_hparams
      # Add a third empty dimension
      x = tf.expand_dims(x, axis=[2])
      x = tf.to_int32(x)
      input_space_id = tf.constant(p_hparams.input_space_id)
      target_space_id = tf.constant(p_hparams.target_space_id)
  
      features = {}
      features["input_space_id"] = input_space_id
      features["target_space_id"] = target_space_id
      features["decode_length"] = (
          IMAGE_DECODE_LENGTH
          if input_is_image
          else tf.constant(decode_hp.extra_length)
      )
      features["inputs"] = x
      # Save inputs to "partial_targets" when prepending inputs to targets. Also
      # keep "inputs" as some models crash if they don't exist.
      if getattr(hparams, "prepend_mode", "none") != "none":
          shape = tf.shape(x)
          partial_targets = tf.reshape(x, [shape[0], shape[1]])
          partial_targets = tf.pad(partial_targets, [[0, 0], [0, 1]])
          features["partial_targets"] = partial_targets
      return features
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import operator
  import os
  import re
  import string
  import time
  import numpy
  import six
  from six.moves import input
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import hparam
  from tensor2tensor.utils import mlperf_log
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 18 for calling a global function with example usage: _decode_input_tensor_to_features_dict(feature_map, hparams, decode_hp) and returns: features