a7d92f7020dfe8854430ef13ed2923b2606a6262,torchsample/transforms/affine_transforms.py,Shear,__call__,#Shear#,470
Before Change
if self.lazy:
return shear_matrix
else:
x_transformed = th_affine2d(x,
shear_matrix,
mode=self.interp[0])
if y is not None:
y_transformed = th_affine2d(y,
shear_matrix,
mode=self.interp[1])
return x_transformed, y_transformed
else:
return x_transformed
class RandomZoom(object):
def __init__(self,
zoom_range,
After Change
self.lazy = lazy
def __call__(self, *inputs):
if not isinstance(self.interp, (tuple,list)):
interp = [self.interp]*len(inputs)
else:
interp = self.interp
theta = (math.pi * self.value) / 180
shear_matrix = th.FloatTensor([[1, -math.sin(theta), 0],
[0, math.cos(theta), 0],
[0, 0, 1]])
if self.lazy:
return shear_matrix
else:
outputs = []
for idx, _input in enumerate(inputs):
input_tf = th_affine2d(_input,
shear_matrix,
mode=interp[idx],
center=True)
outputs.append(input_tf)
return outputs if idx > 1 else outputs[0]
class RandomZoom(object):

In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 42
Instances
Project Name: ncullen93/torchsample
Commit Name: a7d92f7020dfe8854430ef13ed2923b2606a6262
Time: 2017-05-11
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Shear
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: a7d92f7020dfe8854430ef13ed2923b2606a6262
Time: 2017-05-11
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Zoom
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: a7d92f7020dfe8854430ef13ed2923b2606a6262
Time: 2017-05-11
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Translate
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: a7d92f7020dfe8854430ef13ed2923b2606a6262
Time: 2017-05-11
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Shear
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: a7d92f7020dfe8854430ef13ed2923b2606a6262
Time: 2017-05-11
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Rotate
Method Name: __call__