class_docstr: Wrapper for tf.data.Dataset to permit extensions.
class_docstr_tok: ["Wrapper","for","tf.data.Dataset","to","permit","extensions","."]
code: def from_tfds(
      cls,
      dataset: tf.data.Dataset,
      image_shape: Tuple[int, int, int],
      augment_fn: Optional[Callable] = None,
  ):
      return cls(
          dataset.map(
              lambda x: dict(
                  image=tf.cast(x["image"], tf.float32) / 127.5 - 1,
                  label=x["label"],
              )
          ),
          image_shape,
          augment_fn=augment_fn,
          parse_fn=None,
      )
  
file_path: privacy/research/mi_lira_2021/dataset.py
imports: from typing import Callable, Optional, Tuple, List
  import numpy
  import tensorflow
label_desc: Use image node_id 4 for calling the DataSet obj's underlying member method code with example usage: obj.from_tfds(cls, dataset, image_shape, augment_fn) and returns: cls