15c7935788534423c3b22626fb1a6978a59878b6,torchsample/utils.py,,th_nearest_interp_2d,#Any#Any#,112
Before Change
input_flat = th_c_flatten(input)
mapped_vals = torch.stack([input_flat[i][idx]
for i in range(input.size(0))], 0)
return mapped_vals.view_as(input)
After Change
coords[:,0] = torch.clamp(coords[:,0], 0, input.size(1)-1).round()
coords[:,1] = torch.clamp(coords[:,1], 0, input.size(2)-1).round()
stride = torch.LongTensor(input.stride())[1:].float()
idx = coords.mv(stride).long()
input_flat = th_flatten(input)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: ncullen93/torchsample
Commit Name: 15c7935788534423c3b22626fb1a6978a59878b6
Time: 2017-04-25
Author: ncullen@modv-vlan533.0658.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/utils.py
Class Name:
Method Name: th_nearest_interp_2d
Project Name: lcswillems/torch-rl
Commit Name: 4bc24901700d09102a380ef93ba79578f44d274e
Time: 2018-04-11
Author: lcswillems@gmail.com
File Name: core/common.py
Class Name:
Method Name: estimate_advantages
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