Implementation of <ahref="https://google-research.github.io/seanet/audiolm/examples/">AudioLM</a>, a Language Modeling Approach to Audio Generation out of Google Research, in Pytorch
assertexists(raw_wave)^(exists(coarse_token_ids)andexists(fine_token_ids)),'either raw waveform (raw_wav) is given, or coarse and fine token ids (coarse_token_ids, fine_token_ids)'
ifexists(raw_wave):
assertexists(self.soundstream),'SoundStream must be provided if given raw wave for training'