6ddf825a4aa1bcf3a35bba8d36bc433fe5ebaa39,torchsample/utils.py,,th_nearest_interp_3d,#Any#Any#,285
Before Change
zc.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)
return mapped_vals.view_as(input)
After Change
coords[:,1] = torch.clamp(coords[:,1], 0, input.size(2)-1).round()
coords[:,2] = torch.clamp(coords[:,2], 0, input.size(3)-1).round()
stride = torch.LongTensor(input.stride())[1:].float()
idx = coords.mv(stride)
input_flat = th_flatten(input)
mapped_vals = input_flat[idx.long()]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
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_3d
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: PIQuIL/QuCumber
Commit Name: 59562fbb1d97a00c04719b9a8e2b9cf69df54571
Time: 2019-12-23
Author: emerali@users.noreply.github.com
File Name: tests/grads_utils.py
Class Name: ComplexGradsUtils
Method Name: algorithmic_gradKL
Project Name: PIQuIL/QuCumber
Commit Name: 59562fbb1d97a00c04719b9a8e2b9cf69df54571
Time: 2019-12-23
Author: emerali@users.noreply.github.com
File Name: tests/grads_utils.py
Class Name: DensityGradsUtils
Method Name: algorithmic_gradKL