From b481cfbd019e1508e90fef39a0eeefc1b2759291 Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Tue, 17 Aug 2021 05:57:43 -0700 Subject: [PATCH] Correct shape for default grid_sizes Summary: Small fix for omitting this argument. Reviewed By: nikhilaravi Differential Revision: D29548610 fbshipit-source-id: f25032fab3faa2f09006f5fcf8628138555f2f20 --- pytorch3d/ops/points_to_volumes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytorch3d/ops/points_to_volumes.py b/pytorch3d/ops/points_to_volumes.py index 6b9efc994..59f43fe1b 100644 --- a/pytorch3d/ops/points_to_volumes.py +++ b/pytorch3d/ops/points_to_volumes.py @@ -181,8 +181,11 @@ def add_points_features_to_volume_densities_features( # init the volumetric grid sizes if uninitialized if grid_sizes is None: - grid_sizes = torch.LongTensor(list(volume_densities.shape[2:])).to( - volume_densities + # grid sizes shape (minibatch, 3) + grid_sizes = ( + torch.LongTensor(list(volume_densities.shape[2:])) + .to(volume_densities) + .expand(volume_densities.shape[0], 3) ) # flatten densities and features