code: def _tf_style_decode(decode_fn):
      """Method decorator for `tf_style(_adaptive)_encoding_stage`."""
  
      def actual_decode_fn(
          self,
          encoded_tensors,
          decode_params,
          num_summands=None,
          shape=None,
          name=None,
      ):
          """Modified `decode` method."""
          values = list(encoded_tensors.values()) + list(
              decode_params.values()
          )
          with tf.compat.v1.variable_scope(
              name, self.name + DECODE_SCOPE_SUFFIX, values
          ):
              encoded_tensors = tf.nest.map_structure(
                  tf.convert_to_tensor, encoded_tensors
              )
              decode_params = tf.nest.map_structure(
                  tf.convert_to_tensor, decode_params
              )
              if shape is not None:
                  shape = tf.convert_to_tensor(shape)
              if num_summands is not None:
                  num_summands = tf.convert_to_tensor(num_summands)
              return decode_fn(
                  self,
                  encoded_tensors,
                  decode_params,
                  num_summands=num_summands,
                  shape=shape,
                  name=name,
              )
  
      return actual_decode_fn
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import enum
  import six
  import tensorflow
label_desc: Use image node_id 8 for calling a global function with example usage: _tf_style_decode(decode_fn) and returns: actual_decode_fn, decode_fn