Skip to content

🐍 Geometric Computer Vision Library for Spatial AI

Fix robots for web crawlers (#2790)

Edgar Riba265211b774d5
diff --git a/docs/source/_extra/googlef1b16a85a18694bd.html b/docs/source/_extra/googlef1b16a85a18694bd.html
deleted file mode 100644
index 8b7d1d6ed..000000000
--- a/docs/source/_extra/googlef1b16a85a18694bd.html
+++ /dev/null
@@ -1 +0,0 @@
-google-site-verification: googlef1b16a85a18694bd.html
diff --git a/docs/source/_extra/robots.txt b/docs/source/_extra/robots.txt
new file mode 100644
index 000000000..162ed5bea
--- /dev/null
+++ b/docs/source/_extra/robots.txt
@@ -0,0 +1,6 @@
+User-agent: *
+ Allow: /*/latest/
+ Allow: /en/latest/
+ Allow: /*/stable/
+ Allow: /en/stable/
+ Disallow: /
diff --git a/docs/source/conf.py b/docs/source/conf.py
index c141294bf..2c94aaa3a 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -154,7 +154,7 @@ html_favicon = "_static/img/kornia_logo_favicon.png"
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]
-html_extra_path = ["_extra"]
+html_extra_path = ["_extra/robots.txt"]
# Output file base name for HTML help builder.
htmlhelp_basename = "Kornia"
diff --git a/kornia/utils/helpers.py b/kornia/utils/helpers.py
index a61416562..3f6e2bdd0 100644
--- a/kornia/utils/helpers.py
+++ b/kornia/utils/helpers.py
@@ -226,15 +226,13 @@ def _torch_linalg_svdvals(input: Tensor) -> Tensor:
def _torch_solve_cast(A: Tensor, B: Tensor) -> Tensor:
"""Helper function to make torch.solve work with other than fp32/64.
- The function torch.solve is only implemented for fp32/64 which makes impossible to be used by fp16 or others. What
- this function does, is cast input data type to fp32, apply torch.svd, and cast back to the input dtype.
+ For stable operation, the input matrices should be cast to fp64, and the output will be cast back to the input
+ dtype.
"""
- # dtype: torch.dtype = A.dtype
- # if dtype not in (torch.float32, torch.float64):
- # dtype = torch.float32
-
+ # cast to fp64 and solve
out = torch.linalg.solve(A.to(torch.float64), B.to(torch.float64))
+ # cast back to the input dtype
return out.to(A.dtype)