class_docstr: Urmp dataset using unsegmented data.
  
  Unsegmented here means that the data samples are not segmented to 4-second
  chunks as in UrmpMidi dataset.
class_docstr_tok: ["Urmp","dataset","using","unsegmented","data",".","Unsegmented","here","means","that","the","data","samples","are","not","segmented","to","4-second","chunks","as","in","UrmpMidi","dataset","."]
code: def get_dataset(self, shuffle=True):
      instrument_ids = range(len(self._INSTRUMENTS))
      inst_vocab = tf.lookup.StaticHashTable(
          tf.lookup.KeyValueTensorInitializer(
              self._INSTRUMENTS, instrument_ids
          ),
          -1,
      )
  
      def _reshape_tensors(data):
          data["audio"] = tf.sparse.to_dense(data["audio"])
          data["note_active_frame_indices"] = tf.reshape(
              tf.sparse.to_dense(data["note_active_frame_indices"]),
              (-1, 128),
          )
          data["note_active_velocities"] = tf.reshape(
              tf.sparse.to_dense(data["note_active_velocities"]),
              (-1, 128),
          )
          data["instrument_id"] = inst_vocab.lookup(
              data["instrument_id"]
          )
          data["midi"] = tf.argmax(
              data["note_active_frame_indices"], axis=-1
          )
          data["f0_hz"] = tf.sparse.to_dense(data["f0_hz"])[
              ..., tf.newaxis
          ]
          data["loudness_db"] = tf.sparse.to_dense(data["loudness_db"])[
              ..., tf.newaxis
          ]
          # reshape and rename things
          onsets = tf.reduce_sum(
              tf.reshape(
                  tf.sparse.to_dense(data["note_onsets"]), (-1, 128)
              ),
              axis=-1,
          )
          data["onsets"] = tf.cast(onsets > 0, tf.int64)
          offsets = tf.reduce_sum(
              tf.reshape(
                  tf.sparse.to_dense(data["note_offsets"]), (-1, 128)
              ),
              axis=-1,
          )
          data["offsets"] = tf.cast(offsets > 0, tf.int64)
  
          return data
  
      ds = super().get_dataset(shuffle)
      ds = ds.map(_reshape_tensors, num_parallel_calls=_AUTOTUNE)
      return ds
  
imports: import os
  from absl import logging
  from ddsp.spectral_ops import CREPE_FRAME_SIZE
  from ddsp.spectral_ops import CREPE_SAMPLE_RATE
  from ddsp.spectral_ops import get_framed_lengths
  import gin
  import tensorflow.compat.v2
  import tensorflow_datasets
label_desc: Use image node_id 2 for calling the UrmpMidiUnsegmented obj's underlying member method code with example usage: obj.get_dataset(shuffle) and returns: ds, data