6ddf825a4aa1bcf3a35bba8d36bc433fe5ebaa39,torchsample/utils.py,,th_nearest_interp_2d,#Any#Any#,149
Before Change
yc = torch.clamp(coords[:,:,1], 0, input.size(2)-1)
// round to nearest coordinate
coords = torch.stack([xc.round().long(),
yc.round().long()], 2)
// gather image values at coordinates
mapped_vals = torch.stack([th_gather_nd(input[i], coords[i])
for i in range(input.size(0))], 0)
After Change
coords[:,1] = torch.clamp(coords[:,1], 0, input.size(2)-1).round()
stride = torch.FloatTensor(input.stride())[1:]
idx = coords.mv(stride).long()
input_flat = th_c_flatten(input)
mapped_vals = torch.stack([input_flat[i][idx]
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: ncullen93/torchsample
Commit Name: 6ddf825a4aa1bcf3a35bba8d36bc433fe5ebaa39
Time: 2017-04-24
Author: ncullen@Nicks-MacBook-Pro.local
File Name: torchsample/utils.py
Class Name:
Method Name: th_nearest_interp_2d
Project Name: ncullen93/torchsample
Commit Name: 6ddf825a4aa1bcf3a35bba8d36bc433fe5ebaa39
Time: 2017-04-24
Author: ncullen@Nicks-MacBook-Pro.local
File Name: torchsample/utils.py
Class Name:
Method Name: th_nearest_interp_3d
Project Name: markovmodel/PyEMMA
Commit Name: 6379ad6fad9cd3c944390538faf945fdc8662b35
Time: 2017-12-15
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/serialization/tests/_test_classes.py
Class Name: test_cls_v3
Method Name: test_cls_v3_1
Project Name: markovmodel/PyEMMA
Commit Name: 6379ad6fad9cd3c944390538faf945fdc8662b35
Time: 2017-12-15
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/serialization/tests/_test_classes.py
Class Name: test_cls_v2
Method Name: test_cls_v2_1