faf3aa876462323f2fa721ebd633752d6489808f,sru/modules.py,SRU,forward,#SRU#Any#Any#Any#,536

Before Change


            batch_size = input.size(1)
            mask_pad = torch.arange(batch_size,
                                    device=batch_sizes.device).expand(length, batch_size)
            mask_pad = (mask_pad >= batch_sizes.view(length, 1)).contiguous()
        else:
            length = input.size(0)
            batch_size = input.size(1)
            batch_sizes = None

After Change


            input, lengths = nn.utils.rnn.pad_packed_sequence(input)
            max_length = lengths.max().item()
            mask_pad = torch.ByteTensor([[0] * l + [1] * (max_length - l) for l in lengths.tolist()])
            mask_pad = mask_pad.to(input.device).transpose(0, 1).contiguous()

        // The dimensions of `input` should be: `(sequence_length, batch_size, input_size)`.
        if input.dim() != 3:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: asappresearch/sru
Commit Name: faf3aa876462323f2fa721ebd633752d6489808f
Time: 2020-09-18
Author: taolei@csail.mit.edu
File Name: sru/modules.py
Class Name: SRU
Method Name: forward


Project Name: arraiy/torchgeometry
Commit Name: a606a68ff74ed2b2e35f7079a1570310655e4e6d
Time: 2019-03-04
Author: edgar.riba@gmail.com
File Name: torchgeometry/core/depth_warper.py
Class Name: DepthWarper
Method Name: warp_grid


Project Name: 1adrianb/face-alignment
Commit Name: 45394d439c23ebfa7a990bd394385e841ca7bd2e
Time: 2020-12-18
Author: adrian@adrianbulat.com
File Name: face_alignment/detection/sfd/detect.py
Class Name:
Method Name: batch_detect