Skip to content

Commit

Permalink
Avoid fit on empty set
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonPi committed Aug 22, 2024
1 parent b964f7c commit 5f28235
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pytorch_volumetric/voxel.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def get_known_pos_and_values(self):
def resize_to_fit(self):
"""Resize voxel grid to fit to the known points"""
known_pos, known_val = self.get_known_pos_and_values()
if known_pos.numel() == 0:
return
min = known_pos.min(dim=0).values
max = known_pos.max(dim=0).values
# fit to the min and max of data
Expand Down

0 comments on commit 5f28235

Please sign in to comment.