d51512dcf397a6b6a70fe46885f1b5acd45205b3,scattering/scattering2d/utils.py,Modulus,__call__,#Modulus#Any#,110

Before Change


    def __call__(self, input):
        if not self.jit or not input.is_cuda:
            norm = input.norm(p=2, dim=-1, keepdim=True)
            return torch.cat([norm, norm.new(norm.size()).zero_()], -1)

        out = input.new(input.size())
        input = input.contiguous()

After Change



    def __call__(self, input):

        if not input.is_cuda and self.backend=="skcuda":
            raise RuntimeError("Use the torch backend for cpu tensors!")

        if self.backend=="torch":
            norm = input.norm(p=2, dim=-1, keepdim=True)
            return torch.cat([norm, torch.zeros_like(norm)], -1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: kymatio/kymatio
Commit Name: d51512dcf397a6b6a70fe46885f1b5acd45205b3
Time: 2018-11-21
Author: edouard.oyallon@centralesupelec.fr
File Name: scattering/scattering2d/utils.py
Class Name: Modulus
Method Name: __call__


Project Name: zhanghang1989/PyTorch-Encoding
Commit Name: 2d21747abdbf1968a9d565a4090d5d6297ade71a
Time: 2018-06-04
Author: zhang.hang@rutgers.edu
File Name: encoding/functions/encoding.py
Class Name: _scaledL2
Method Name: forward


Project Name: zhanghang1989/PyTorch-Encoding
Commit Name: 2d21747abdbf1968a9d565a4090d5d6297ade71a
Time: 2018-06-04
Author: zhang.hang@rutgers.edu
File Name: encoding/functions/encoding.py
Class Name: _aggregate
Method Name: forward