mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-20 22:56:03 +08:00
fix ruff check (#3328)
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -337,7 +337,7 @@ class PixelSampler:
|
||||
collated_batch = {
|
||||
key: value[c, y, x]
|
||||
for key, value in batch.items()
|
||||
if key != "image_idx" and key != "image" and key != "mask" and key != "depth_image" and value is not None
|
||||
if key not in ("image_idx", "image", "mask", "depth_image") and value is not None
|
||||
}
|
||||
|
||||
collated_batch["image"] = torch.cat(all_images, dim=0)
|
||||
|
||||
@@ -101,7 +101,7 @@ def nerfstudio_collate(batch: Any, extra_mappings: Union[Dict[type, Callable], N
|
||||
storage = elem.storage()._new_shared(numel, device=elem.device)
|
||||
out = elem.new(storage).resize_(len(batch), *list(elem.size()))
|
||||
return torch.stack(batch, 0, out=out)
|
||||
elif elem_type.__module__ == "numpy" and elem_type.__name__ != "str_" and elem_type.__name__ != "string_":
|
||||
elif elem_type.__module__ == "numpy" and elem_type.__name__ not in ("str_", "string_"):
|
||||
if elem_type.__name__ in ("ndarray", "memmap"):
|
||||
# array of string classes and object
|
||||
if np_str_obj_array_pattern.search(elem.dtype.str) is not None:
|
||||
|
||||
Reference in new issue
Block a user