Skip to content

Commit f130867

Browse files
bottlerfacebook-github-bot
authored andcommitted
avoid torch.range
Summary: Avoid unintended use of torch.range. Reviewed By: kjchalup Differential Revision: D40341396 fbshipit-source-id: 108295983afdec0ca9e43178fef9c65695150bc1
1 parent 4d9215b commit f130867

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pytorch3d/renderer/implicit/raysampling.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def forward(
207207
n_rays_per_image,
208208
) = _sample_cameras_and_masks(n_rays_total, cameras, mask)
209209
else:
210-
camera_ids = torch.range(0, len(cameras), dtype=torch.long)
210+
camera_ids = torch.arange(len(cameras), dtype=torch.long)
211211

212212
batch_size = cameras.R.shape[0]
213213
device = cameras.device
@@ -438,7 +438,7 @@ def forward(
438438
n_rays_per_image,
439439
) = _sample_cameras_and_masks(self._n_rays_total, cameras, None)
440440
else:
441-
camera_ids = torch.range(0, len(cameras), dtype=torch.long)
441+
camera_ids = torch.arange(len(cameras), dtype=torch.long)
442442
n_rays_per_image = self._n_rays_per_image
443443

444444
batch_size = cameras.R.shape[0]

0 commit comments

Comments
 (0)