class_docstr: "Class to read a dataset of embeddings of obfuscated images.
  
  This class is used to read a tfrecord which contains the embeddings of the
  images directly. The dataset needs to contain two fields:
  - 'embed': The embeddings of the images. This field should contain a float
      vector of dimension (num_views * embed_dim), so it can then be reshaped to
      a 2D tensor.
  - 'label': The int label of the corresponding sample.
  
  Attributes:
    embed_dim: The dimension of the embeddings.
    num_views: Number of different views of each image to be found in the
      dataset (equal to the number of obfuscations + 1 for the clean image).
class_docstr_tok: ["``","Class","to","read","a","dataset","of","embeddings","of","obfuscated","images",".","This","class","is","used","to","read","a","tfrecord","which","contains","the","embeddings","of","the","images","directly",".","The","dataset","needs","to","contain","two","fields",":","-","'embed","'",":","The","embeddings","of","the","images",".","This","field","should","contain","a","float","vector","of","dimension","(","num_views","*","embed_dim",")",",","so","it","can","then","be","reshaped","to","a","2D","tensor",".","-","'label","'",":","The","int","label","of","the","corresponding","sample",".","Attributes",":","embed_dim",":","The","dimension","of","the","embeddings",".","num_views",":","Number","of","different","views","of","each","image","to","be","found","in","the","dataset","(","equal","to","the","number","of","obfuscations","+","1","for","the","clean","image",")","."]
code: def _read_dataset(
      self, context: Optional[tf.distribute.InputContext] = None
  ) -> tf.data.Dataset:
      dataset = tf.data.Dataset.from_tensor_slices(self._filenames)
      if context and context.num_input_pipelines > 1:
          dataset = dataset.shard(
              context.num_input_pipelines, context.input_pipeline_id
          )
      dataset = dataset.interleave(
          self._read_file,
          deterministic=not self.is_train,
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
      dataset = dataset.unbatch()
      return dataset
  
imports: import abc
  from typing import Optional, Sequence, Tuple
  from meo.mlp_baseline import data_utils
  import tensorflow
  import tensorflow_datasets
label_desc: Use image node_id 4 for calling the ObfuscatedEmbeddingDataset obj's underlying member method code with example usage: obj._read_dataset(context) and returns: dataset