def __getitem__(self, index):
     # Load acoustic feature and pad
     x_batch = [
         torch.FloatTensor(np.load(os.path.join(self.root, x_file)))
         for x_file in self.X[index]
     ]
     x_pad_batch = pad_sequence(x_batch, batch_first=True)
     if self.run_mockingjay:
         x_pad_batch = process_train_MAM_data(spec=(x_pad_batch, ),
                                              config=self.mock_config)
     return x_pad_batch
 def __getitem__(self, index):
     # Load acoustic feature and pad
     x_batch = [
         torch.FloatTensor(np.load(os.path.join(self.root, x_file)))
         for x_file in self.X[index]
     ]
     x_pad_batch = pad_sequence(x_batch, batch_first=True)
     # Return (x_spec, t_spec)
     t_batch = [
         torch.FloatTensor(np.load(os.path.join(self.t_root, t_file)))
         for t_file in self.T[index]
     ]
     t_pad_batch = pad_sequence(t_batch, batch_first=True)
     batch = process_train_MAM_data(spec=(x_pad_batch, t_pad_batch),
                                    config=self.mock_config)
     return batch