0e0d1e590e8cdae50d04a96617ea6601446f99fb,torchaudio/transforms.py,PadTrim,__call__,#PadTrim#Any#,104

Before Change


        if self.max_len > tensor.size(0):
            pad = torch.ones((self.max_len - tensor.size(0),
                              tensor.size(1))) * self.fill_value
            pad = pad.type_as(tensor)
            tensor = torch.cat((tensor, pad), dim=0)
        elif self.max_len < tensor.size(0):
            tensor = tensor[:self.max_len, :]
        return tensor

After Change



            padding_size = [self.max_len - tensor.size(self.len_dim) if i == self.len_dim
                            else tensor.size(self.ch_dim)
                            for i in range(2)]
            pad = torch.empty(padding_size, dtype=tensor.dtype).fill_(self.fill_value)
            tensor = torch.cat((tensor, pad), dim=self.len_dim)
        elif self.max_len < tensor.size(self.len_dim):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pytorch/audio
Commit Name: 0e0d1e590e8cdae50d04a96617ea6601446f99fb
Time: 2018-12-25
Author: david@da3.net
File Name: torchaudio/transforms.py
Class Name: PadTrim
Method Name: __call__


Project Name: facebookresearch/ParlAI
Commit Name: 72c304fa7cac16ed19d8bc75a017f17c8073dd2f
Time: 2020-02-13
Author: roller@fb.com
File Name: parlai/core/torch_generator_agent.py
Class Name: TorchGeneratorAgent
Method Name: _compute_fairseq_bleu


Project Name: rusty1s/pytorch_geometric
Commit Name: fab47fcca9887402f7474c80545311fcb952566f
Time: 2018-05-21
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/transform/random_translate.py
Class Name: RandomTranslate
Method Name: __call__