mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-20 06:35:36 +08:00
torchtyping => jaxtyping (#1838)
* Run `ruff --fix` * Add jaxtyping migration script * Run migration scripts + ruff + black * Merge remote-tracking branch 'origin/main' into brent/jaxtyping * black * Fix lint * fix lint * Cleanup and more specific types * Fixed annotation errors * Fix more errors * Fix annotation * Delete _torchtyping_to_jaxtyping.py --------- Co-authored-by: Matt Tancik <mattt4001@gmail.com>
This commit is contained in:
1 parent
9b6290ea43
commit
6ba2a18b2b
65 files changed
+597
-531
No files matched your search
@@ -72,7 +72,6 @@ def test_nerfstudio_dataparser_split_filelist(mocked_dataset):
|
||||
json.dump(data, f)
|
||||
|
||||
from nerfstudio.data.dataparsers.nerfstudio_dataparser import (
|
||||
DataparserOutputs,
|
||||
Nerfstudio,
|
||||
NerfstudioDataParserConfig,
|
||||
)
|
||||
|
||||
@@ -9,10 +9,8 @@ from nerfstudio.fields.instant_ngp_field import TCNNInstantNGPField
|
||||
|
||||
def test_tcnn_instant_ngp_field():
|
||||
"""Test the tiny-cuda-nn field"""
|
||||
# pylint: disable=import-outside-toplevel
|
||||
# pylint: disable=unused-import
|
||||
try:
|
||||
import tinycudann as tcnn
|
||||
import tinycudann as tcnn # pylint:disable=import-outside-toplevel, unused-import
|
||||
except ImportError as e:
|
||||
# tinycudann module doesn't exist
|
||||
print(e)
|
||||
|
||||
@@ -12,7 +12,7 @@ def test_temporal_grid():
|
||||
print("Unable to test temporal grid without GPU, since CUDA kernels involved.")
|
||||
return
|
||||
|
||||
params = dict(
|
||||
model = temporal_grid.TemporalGridEncoder(
|
||||
temporal_dim=2,
|
||||
input_dim=1,
|
||||
num_levels=1,
|
||||
@@ -23,8 +23,7 @@ def test_temporal_grid():
|
||||
desired_resolution=None,
|
||||
gridtype="tiled",
|
||||
align_corners=False,
|
||||
)
|
||||
model = temporal_grid.TemporalGridEncoder(**params).cuda()
|
||||
).cuda()
|
||||
random_embedding = torch.rand_like(model.embeddings)
|
||||
random_embedding[:, 0] = torch.arange(8).to(model.embeddings)
|
||||
model.embeddings = torch.nn.Parameter(random_embedding, requires_grad=True)
|
||||
|
||||
@@ -36,9 +36,9 @@ def test_init():
|
||||
|
||||
dummy_vals: torch.Tensor = None
|
||||
|
||||
dummy = Dummy(dummy_vals=torch.ones(1))
|
||||
Dummy(dummy_vals=torch.ones(1))
|
||||
with pytest.raises(ValueError):
|
||||
dummy = Dummy()
|
||||
Dummy()
|
||||
|
||||
|
||||
def test_broadcasting():
|
||||
|
||||
Reference in new issue
Block a user