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

Before Change


            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()

After Change


        self.dtype = dtype

    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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: interactiveaudiolab/nussl
Commit Name: 889a295c5c4e0c1cf344e49f2020917a410f64d1
Time: 2020-05-03
Author: abugler@gmail.com
File Name: nussl/core/augmentation.py
Class Name:
Method Name: time_stretch


Project Name: interactiveaudiolab/nussl
Commit Name: ceb4e40c074d2f0d0bde8e97c7b4493971281a9b
Time: 2020-05-14
Author: abugler@gmail.com
File Name: nussl/core/augmentation.py
Class Name:
Method Name: time_stretch