Switching to Torch 2.0 by default. (#1922)

* Update requirements for torch 2.0

* Update docs

* Fix missing _LRScheduler import

* Fix pylint issues

* Update docs, drop 1.13

* Fix pip postfix version

* fix docs

* Allow python 1.13 (for now)

* Minor fix for torch.compile

* Switch to torch.compile

* ruff

* Fix test

---------

Co-authored-by: Matt Tancik <mattt4001@gmail.com>
Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
This commit is contained in:
authored and GitHub committed 2023-05-17 16:03:17 -07:00
1 parent be291970db
commit e898f562e6
10 files changed
+83 -75

No files matched your search

+3 -2
View File
@@ -25,6 +25,8 @@ from jaxtyping import Float
from numpy.typing import NDArray
from torch import Tensor
from nerfstudio.utils.misc import torch_compile
_EPS = np.finfo(float).eps * 4.0
@@ -340,7 +342,6 @@ def get_distortion_params(
return torch.Tensor([k1, k2, k3, k4, p1, p2])
@torch.jit.script
def _compute_residual_and_jacobian(
x: torch.Tensor,
y: torch.Tensor,
@@ -406,7 +407,7 @@ def _compute_residual_and_jacobian(
return fx, fy, fx_x, fx_y, fy_x, fy_y
@torch.jit.script
@torch_compile(dynamic=True, mode="reduce-overhead", backend="eager")
def radial_and_tangential_undistort(
coords: torch.Tensor,
distortion_params: torch.Tensor,