def decode_example(self, tfexample_data):
    """See base class for details."""
    # TODO(epot): Support dynamic shape
    if self.shape.count(None) < 2:
      # Restore the shape if possible. TF Example flattened it.
      shape = [-1 if i is None else i for i in self.shape]
      tfexample_data = tf.reshape(tfexample_data, shape)
    if tfexample_data.dtype != self.dtype:
      tfexample_data = tf.dtypes.cast(tfexample_data, self.dtype)
    return tfexample_data
def decode_example ( self , tfexample_data ) : if self . shape . count ( None ) < 2 : shape = [ - 1 if i is None else i for i in self . shape ] tfexample_data = tf . reshape ( tfexample_data , shape ) if tfexample_data . dtype != self . dtype : tfexample_data = tf . dtypes . cast ( tfexample_data , self . dtype ) return tfexample_data
See base class for details.