class_docstr: A data decoder that decodes a scalar, e.g., int label or float number.
  
  The only operation is to cast the data into a specified data type.
  
  Args:
      dtype: A :tf_main:`tf DType <DType>` that data is cast into. Can be
          `tf.int32` or `tf.float32`.
      data_name (str): Name of the decoded data.
class_docstr_tok: ["A","data","decoder","that","decodes","a","scalar",",","e.g.",",","int","label","or","float","number",".","The","only","operation","is","to","cast","the","data","into","a","specified","data","type",".","Args",":","dtype",":","A",":","tf_main",":","`","tf","DType","<","DType",">","`","that","data","is","cast","into",".","Can","be","`","tf.int32","`","or","`","tf.float32","`",".","data_name","(","str",")",":","Name","of","the","decoded","data","."]
docstr: Decodes the data to return the tensors specified by the list of
  items.
  
  Args:
      data: The scalar data to decode.
      items: A list of strings, each of which is the name of the resulting
          tensors to retrieve.
  
  Returns:
      A list of tensors, each of which corresponds to each item.
docstr_tok: ["Decodes","the","data","to","return","the","tensors","specified","by","the","list","of","items",".","Args",":","data",":","The","scalar","data","to","decode",".","items",":","A","list","of","strings",",","each","of","which","is","the","name","of","the","resulting","tensors","to","retrieve",".","Returns",":","A","list","of","tensors",",","each","of","which","corresponds","to","each","item","."]
code: def decode(self, data, items):
      """Decodes the data to return the tensors specified by the list of
      items.
  
      Args:
          data: The scalar data to decode.
          items: A list of strings, each of which is the name of the resulting
              tensors to retrieve.
  
      Returns:
          A list of tensors, each of which corresponds to each item.
      """
      data = tf.reshape(data, shape=[])
      if data.dtype is tf.string:
          decoded_data = tf.string_to_number(data, out_type=self._dtype)
      else:
          decoded_data = tf.cast(data, self._dtype)
      outputs = {self._data_name: decoded_data}
      return [outputs[item] for item in items]
  
imports: import numpy
  import tensorflow
  from tensorflow.contrib.slim.python.slim.data import data_decoder
  from texar.tf.data.vocabulary import SpecialTokens
  from texar.tf.utils import dtypes
  from texar.tf.hyperparams import HParams
label_desc: Use image node_id 3 for calling the ScalarDataDecoder obj's underlying member method code with example usage: obj.decode(data, items) and returns: unknown