mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-19 14:23:57 +08:00
Speedup eval and training with better data management (#492)
move to tensors to gpu earlier
This commit is contained in:
1 parent
96e1f2a698
commit
a43776d76d
5 files changed
+13
-12
No files matched your search
@@ -29,7 +29,7 @@ def components_from_spherical_harmonics(levels: int, directions: TensorType[...,
|
||||
directions: Spherical hamonic coefficients
|
||||
"""
|
||||
num_components = levels**2
|
||||
components = torch.zeros((*directions.shape[:-1], num_components)).to(directions.device)
|
||||
components = torch.zeros((*directions.shape[:-1], num_components), device=directions.device)
|
||||
|
||||
assert 1 <= levels <= 5, f"SH levels must be in [1,4], got {levels}"
|
||||
assert directions.shape[-1] == 3, f"Direction input should have three dimensions. Got {directions.shape[-1]}"
|
||||
|
||||
Reference in new issue
Block a user