mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-18 13:53:44 +08:00
Move camera optimization out of datamanager and parallelize dataloading (#2092)
This commit is contained in:
1 parent
1b85fb528b
commit
e694f341a7
13 files changed
+531
-134
No files matched your search
@@ -261,6 +261,14 @@ class TensorDataclass:
|
||||
"""
|
||||
return self._apply_fn_to_fields(lambda x: x.to(device))
|
||||
|
||||
def pin_memory(self: TensorDataclassT) -> TensorDataclassT:
|
||||
"""Pins the tensor dataclass memory
|
||||
|
||||
Returns:
|
||||
TensorDataclass: A new TensorDataclass with the same data but pinned.
|
||||
"""
|
||||
return self._apply_fn_to_fields(lambda x: x.pin_memory())
|
||||
|
||||
def _apply_fn_to_fields(
|
||||
self: TensorDataclassT,
|
||||
fn: Callable,
|
||||
|
||||
Reference in new issue
Block a user