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: 6

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: ncullen93/torchsample
Commit Name: 2079a72d90e527149e527b5cb376b37ddc9e25bd
Time: 2017-05-09
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Affine
Method Name: __init__


Project Name: BVLC/caffe
Commit Name: 738c8758e30c6f8bdf9155529aeb431547af65d6
Time: 2014-05-19
Author: shelhamer@imaginarynumber.net
File Name: python/caffe/pycaffe.py
Class Name:
Method Name: _Net_set_mean