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.unsqueeze(0)
            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: 6

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: cornellius-gp/gpytorch
Commit Name: 60a342edc8b501802135df44869353cc8604d838
Time: 2018-01-11
Author: gpleiss@gmail.com
File Name: gpytorch/kernels/rbf_kernel.py
Class Name: RBFKernel
Method Name: forward


Project Name: mozilla/TTS
Commit Name: 5e148038be5971f2c7c811d46a1d7b28c759ecda
Time: 2020-01-09
Author: root@sp-mlc3-5423-0.mlc
File Name: layers/common_layers.py
Class Name: GravesAttention
Method Name: forward