save image_coords as non-persistent buffer (#1216)

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
This commit is contained in:
hturkiandMatthew Tancik authored and GitHub committed 2023-01-16 15:21:44 -08:00
1 parent 23ca7a7cc8
commit bd1060ee83
1 file changed
+1 -1
@@ -36,7 +36,7 @@ class RayGenerator(nn.Module):
super().__init__()
self.cameras = cameras
self.pose_optimizer = pose_optimizer
self.image_coords = nn.Parameter(cameras.get_image_coords(), requires_grad=False)
self.register_buffer("image_coords", cameras.get_image_coords(), persistent=False)
def forward(self, ray_indices: TensorType["num_rays", 3]) -> RayBundle:
"""Index into the cameras to generate the rays.