Fix interpolation boundary with one test point
@@ -100,6 +100,9 @@ class Interpolation(object):
lower_grid_pt_idxs = lower_grid_pt_idxs - interp_points.max()
lower_grid_pt_idxs.detach_()
+ if len(lower_grid_pt_idxs.shape) == 0:
+ lower_grid_pt_idxs = lower_grid_pt_idxs.unsqueeze(0)
+
scaled_dist = lower_pt_rel_dists.unsqueeze(-1) + interp_points_flip.unsqueeze(-2)
dim_interp_values = self._cubic_interpolation_kernel(scaled_dist)
