π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
fix cuda tests failing (#1941)
Dmytro Mishkin765549c227cf
diff --git a/kornia/feature/adalam/core.py b/kornia/feature/adalam/core.pyindex 3f66d264b..b318b2344 100644--- a/kornia/feature/adalam/core.py+++ b/kornia/feature/adalam/core.py@@ -2,7 +2,9 @@ import mathfrom typing import Optional, Tuple, Unionimport torch-from torch import Tensor, tensor+from torch import tensor++from kornia.core import Tensorfrom .ransac import ransacfrom .utils import dist_matrix, orientation_diff@@ -341,7 +343,7 @@ def adalam_core(final_matches, idxs, counts = torch.unique(final_matches, dim=0, return_inverse=True, return_counts=True)_, ind_sorted = torch.sort(idxs)cum_sum = counts.cumsum(0)- cum_sum = torch.cat((torch.tensor([0]), cum_sum[:-1]))+ cum_sum = torch.cat((torch.tensor([0], dtype=cum_sum.dtype, device=cum_sum.device), cum_sum[:-1]))first_indicies = ind_sorted[cum_sum]accepted_dist = accepted_dist[first_indicies]if return_dist:diff --git a/test/nerf/test_nerf_solver.py b/test/nerf/test_nerf_solver.pyindex d32e2f987..8b18c3bb4 100755--- a/test/nerf/test_nerf_solver.py+++ b/test/nerf/test_nerf_solver.py@@ -36,7 +36,7 @@ class TestNerfSolver:img_rendered = nerf_obj.render_views(camera)[0].permute(2, 0, 1)- assert_close(img_rendered.to(dtype) / 255.0, img[0].to(dtype) / 255.0)+ assert_close(img_rendered.to(device, dtype) / 255.0, img[0].to(device, dtype) / 255.0)def test_single_ray(self, device, dtype):camera = create_one_camera(5, 9, device, dtype)@@ -59,4 +59,4 @@ class TestNerfSolver:img_rendered = nerf_obj.render_views(camera)[0].permute(2, 0, 1)- assert_close(img_rendered.to(dtype) / 255.0, img[0].to(dtype) / 255.0)+ assert_close(img_rendered.to(device, dtype) / 255.0, img[0].to(device, dtype) / 255.0)