Speedup eval and training with better data management (#492)

move to tensors to gpu earlier
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-09-19 18:36:12 -07:00
1 parent 96e1f2a698
commit a43776d76d
5 files changed
+13 -12

No files matched your search

+1 -1
View File
@@ -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]}"