Delete useless lists of tensors put to CUDA which may cause OOM. (#1748)

eval_large_imgs
This commit is contained in:
Yuantao Chen authored and GitHub committed 2023-04-17 23:35:34 -07:00
1 parent e48468cfae
commit ce733a8308
1 file changed
+3 -3
+3 -3
View File
@@ -177,12 +177,12 @@ class Model(nn.Module):
ray_bundle = camera_ray_bundle.get_row_major_sliced_ray_bundle(start_idx, end_idx)
outputs = self.forward(ray_bundle=ray_bundle)
for output_name, output in outputs.items(): # type: ignore
if not torch.is_tensor(output):
# TODO: handle lists of tensors as well
continue
outputs_lists[output_name].append(output)
outputs = {}
for output_name, outputs_list in outputs_lists.items():
if not torch.is_tensor(outputs_list[0]):
# TODO: handle lists of tensors as well
continue
outputs[output_name] = torch.cat(outputs_list).view(image_height, image_width, -1) # type: ignore
return outputs