Skip to content

Commit b481cfb

Browse files
bottlerfacebook-github-bot
authored andcommitted
Correct shape for default grid_sizes
Summary: Small fix for omitting this argument. Reviewed By: nikhilaravi Differential Revision: D29548610 fbshipit-source-id: f25032fab3faa2f09006f5fcf8628138555f2f20
1 parent 46cf197 commit b481cfb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pytorch3d/ops/points_to_volumes.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ def add_points_features_to_volume_densities_features(
181181

182182
# init the volumetric grid sizes if uninitialized
183183
if grid_sizes is None:
184-
grid_sizes = torch.LongTensor(list(volume_densities.shape[2:])).to(
185-
volume_densities
184+
# grid sizes shape (minibatch, 3)
185+
grid_sizes = (
186+
torch.LongTensor(list(volume_densities.shape[2:]))
187+
.to(volume_densities)
188+
.expand(volume_densities.shape[0], 3)
186189
)
187190

188191
# flatten densities and features

0 commit comments

Comments
 (0)