80df9d12f27654b5d21d9833dfe2f9636aa37863,torchsample/transforms/tensor_transforms.py,TypeCast,__call__,#TypeCast#,101

Before Change


        self.dtype = dtype

    def __call__(self, x):
        if self.dtype == th.ByteTensor:
            x = x.byte()
        elif self.dtype == th.CharTensor:
            x = x.char()
        elif self.dtype == th.DoubleTensor:
            x = x.double()
        elif self.dtype == th.FloatTensor:
            x = x.float()
        elif self.dtype == th.IntTensor:
            x = x.int()
        elif self.dtype == th.LongTensor:
            x = x.long()
        elif self.dtype == th.ShortTensor:
            x = x.short()
        else:
            raise Exception("Not a valid Tensor Type")
        return x


class AddChannel(object):

After Change


    def __call__(self, x, y=None):
        x = x.type(self.dtype)
        if y is not None:
            y = y.type(self.dtype)
            return x, y
        return x


class AddChannel(object):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: ncullen93/torchsample
Commit Name: 80df9d12f27654b5d21d9833dfe2f9636aa37863
Time: 2017-05-05
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/tensor_transforms.py
Class Name: TypeCast
Method Name: __call__


Project Name: librosa/librosa
Commit Name: 4515da99519d8aab8c0fd0eabd28e9a332fb92b7
Time: 2015-01-06
Author: brian.mcfee@nyu.edu
File Name: librosa/core.py
Class Name:
Method Name: frames_to_time


Project Name: librosa/librosa
Commit Name: 4515da99519d8aab8c0fd0eabd28e9a332fb92b7
Time: 2015-01-06
Author: brian.mcfee@nyu.edu
File Name: librosa/core.py
Class Name:
Method Name: time_to_frames