f76a4dabb4cd38ee58d01a35c5b511e224d060d2,gpytorch/lazy/sum_batch_lazy_tensor.py,SumBatchLazyTensor,_matmul,#SumBatchLazyTensor#Any#,29

Before Change


        rhs = rhs.unsqueeze(0)
        rhs_size = list(rhs.size())
        rhs_size[0] = self.batch_size()
        rhs = rhs.expand(*rhs_size)

        res = self.base_lazy_tensor._matmul(rhs)
        if self.sum_batch_size is not None:
            res = res.view(-1, self.sum_batch_size, res.size(1), res.size(2))
            res = res.sum(1)
        else:
            res = res.sum(0)

        if isvector:
            res = res.squeeze(-1)
        return res

After Change


            rhs = rhs.expand(self.base_lazy_tensor.size(0), *tuple(rhs.size())[1:])
        else:
            rhs = rhs.unsqueeze(1)
            rhs = rhs.expand(rhs.size(0), self.num_blocks, *tuple(rhs.size())[2:])
            rhs = rhs.contiguous().view(-1, rhs.size(-2), rhs.size(-1))

        res = self.base_lazy_tensor._matmul(rhs)

        if self.num_blocks is not None:
            res = res.view(-1, self.num_blocks, res.size(1), res.size(2))
        res = res.sum(-3)

        if isvector:
            res = res.squeeze(-1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: cornellius-gp/gpytorch
Commit Name: f76a4dabb4cd38ee58d01a35c5b511e224d060d2
Time: 2018-09-17
Author: gpleiss@gmail.com
File Name: gpytorch/lazy/sum_batch_lazy_tensor.py
Class Name: SumBatchLazyTensor
Method Name: _matmul


Project Name: layumi/Person_reID_baseline_pytorch
Commit Name: e9d5373461b0a037716722a461cb12416aa5d1bc
Time: 2018-01-01
Author: zzheng@joo-ml1-dev.j.cinglevue.com
File Name: test.py
Class Name:
Method Name: extract_feature


Project Name: rusty1s/pytorch_geometric
Commit Name: 1f0750670cf8ea24ad264debf9603002ab0fb565
Time: 2021-03-15
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/pool/mem_pool.py
Class Name: MemPool
Method Name: forward