@@ -126,7 +126,8 @@ class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
126
126
every voxel, this calculation can be split into scaffold depth number of xy plane
127
127
calculations if you want the lowest memory usage, one calculation to calculate the
128
128
whole scaffold, but with higher memory footprint or any other number of planes.
129
- Setting to 'inf' calculates all planes at the same time. Defaults to 'inf'.
129
+ Setting to a non-positive number calculates all planes at the same time.
130
+ Defaults to '-1' (=calculating all planes).
130
131
scaffold_max_pool_kernel_size (int): Size of the pooling region to use when
131
132
calculating the scaffold. Defaults to 3.
132
133
scaffold_filter_points (bool): If set to True the points will be filtered using
@@ -173,7 +174,7 @@ class VoxelGridImplicitFunction(ImplicitFunctionBase, torch.nn.Module):
173
174
scaffold_calculating_epochs : Tuple [int , ...] = ()
174
175
scaffold_resolution : Tuple [int , int , int ] = (128 , 128 , 128 )
175
176
scaffold_empty_space_threshold : float = 0.001
176
- scaffold_occupancy_chunk_size : Union [ str , int ] = "inf"
177
+ scaffold_occupancy_chunk_size : int = - 1
177
178
scaffold_max_pool_kernel_size : int = 3
178
179
scaffold_filter_points : bool = True
179
180
@@ -199,11 +200,6 @@ def __post_init__(self) -> None:
199
200
)
200
201
# pyre-ignore[16]
201
202
self ._scaffold_ready = False
202
- if type (self .scaffold_occupancy_chunk_size ) != int :
203
- if self .scaffold_occupancy_chunk_size != "inf" :
204
- raise ValueError (
205
- "`scaffold_occupancy_chunk_size` has to be int or 'inf'."
206
- )
207
203
208
204
def forward (
209
205
self ,
@@ -504,7 +500,7 @@ def _get_scaffold(self, epoch: int) -> bool:
504
500
505
501
chunk_size = (
506
502
self .scaffold_occupancy_chunk_size
507
- if type ( self .scaffold_occupancy_chunk_size ) == int
503
+ if self .scaffold_occupancy_chunk_size > 0
508
504
else points .shape [- 1 ]
509
505
)
510
506
for k in range (0 , points .shape [- 1 ], chunk_size ):
0 commit comments