fix ruff check (#3328)

This commit is contained in:
J.Y. authored and GitHub committed 2024-07-25 09:22:59 +09:00
1 parent 3a46c4274a
commit 702886b213
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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: