class_docstr: A dataset for reading NSynth from Tensorflow Datasets (TFDS).
class_docstr_tok: ["A","dataset","for","reading","NSynth","from","Tensorflow","Datasets","(","TFDS",")","."]
docstr: Loads GANsynth subset of NSynth dataset from TFDS.
docstr_tok: ["Loads","GANsynth","subset","of","NSynth","dataset","from","TFDS","."]
code: def _get_dataset_from_tfds(self):
      """Loads GANsynth subset of NSynth dataset from TFDS."""
      try:
          dataset = tfds.load(
              "nsynth/gansynth_subset:2.3.*",
              data_dir=self._config["tfds_data_dir"],
              split=tfds.Split.TRAIN,
              download=False,
          )
      except AssertionError as e:
          tf.logging.warning(
              "To train with the NSynth dataset, you must either set the "
              "\tfds_data_dir' hparam to 'gs://tfds-data/datasets' (recommended "
              "if running on GCP) or to a local directory where the dataset has "
              "been downloaded. You can download the dataset with the command "
              "`python -m tensorflow_datasets.scripts.download_and_prepare "
              "--datasets=nsynth/gansynth_subset --data_dir=/path/to/local/dir`."
          )
          raise e
      dataset = dataset.shuffle(buffer_size=1000)
      dataset = dataset.repeat()
      return dataset
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from magenta.models.gansynth.lib import spectral_ops
  import numpy
  import tensorflow.compat.v1
  import tensorflow_datasets
label_desc: Use image node_id 1 for calling the NSynthTfdsDataset obj's underlying member method code with example usage: obj._get_dataset_from_tfds() and returns: dataset