@@ -89,7 +89,6 @@ def evaluate_world(
89
89
torch.Tensor: shape (n_grids, n_points, n_features)
90
90
"""
91
91
points_local = locator .world_to_local_coords (points )
92
- # pyre-ignore[29]
93
92
return self .evaluate_local (points_local , grid_values )
94
93
95
94
def evaluate_local (
@@ -139,6 +138,8 @@ class FullResolutionVoxelGrid(VoxelGridBase):
139
138
# the type of grid_values argument needed to run evaluate_local()
140
139
values_type : ClassVar [Type [VoxelGridValuesBase ]] = FullResolutionVoxelGridValues
141
140
141
+ # pyre-fixme[14]: `evaluate_local` overrides method defined in `VoxelGridBase`
142
+ # inconsistently.
142
143
def evaluate_local (
143
144
self , points : torch .Tensor , grid_values : FullResolutionVoxelGridValues
144
145
) -> torch .Tensor :
@@ -213,6 +214,8 @@ class CPFactorizedVoxelGrid(VoxelGridBase):
213
214
n_components : int = 24
214
215
matrix_reduction : bool = True
215
216
217
+ # pyre-fixme[14]: `evaluate_local` overrides method defined in `VoxelGridBase`
218
+ # inconsistently.
216
219
def evaluate_local (
217
220
self , points : torch .Tensor , grid_values : CPFactorizedVoxelGridValues
218
221
) -> torch .Tensor :
@@ -318,6 +321,8 @@ class VMFactorizedVoxelGrid(VoxelGridBase):
318
321
distribution_of_components : Optional [Tuple [int , int , int ]] = None
319
322
matrix_reduction : bool = True
320
323
324
+ # pyre-fixme[14]: `evaluate_local` overrides method defined in `VoxelGridBase`
325
+ # inconsistently.
321
326
def evaluate_local (
322
327
self , points : torch .Tensor , grid_values : VMFactorizedVoxelGridValues
323
328
) -> torch .Tensor :
@@ -392,9 +397,11 @@ def get_shapes(self) -> Dict[str, Tuple]:
392
397
if self .distribution_of_components is None and self .n_components % 3 != 0 :
393
398
raise ValueError ("n_components must be divisible by 3" )
394
399
if self .distribution_of_components is None :
395
- # pyre-ignore[58]
396
400
calculated_distribution_of_components = [
397
- self .n_components // 3 for _ in range (3 )
401
+ # pyre-fixme[58]: `//` is not supported for operand types
402
+ # `Optional[int]` and `int`.
403
+ self .n_components // 3
404
+ for _ in range (3 )
398
405
]
399
406
else :
400
407
calculated_distribution_of_components = self .distribution_of_components
@@ -437,6 +444,7 @@ def get_shapes(self) -> Dict[str, Tuple]:
437
444
return shape_dict
438
445
439
446
447
+ # pyre-fixme[13]: Attribute `voxel_grid` is never initialized.
440
448
class VoxelGridModule (Configurable , torch .nn .Module ):
441
449
"""
442
450
A wrapper torch.nn.Module for the VoxelGrid classes, which
@@ -459,6 +467,7 @@ class VoxelGridModule(Configurable, torch.nn.Module):
459
467
voxel_grid_class_type : str = "FullResolutionVoxelGrid"
460
468
voxel_grid : VoxelGridBase
461
469
470
+ # pyre-fixme[8]: Attribute has type `Tuple[float, float, float]`; used as `float`.
462
471
extents : Tuple [float , float , float ] = 1.0
463
472
translation : Tuple [float , float , float ] = (0.0 , 0.0 , 0.0 )
464
473
@@ -505,8 +514,11 @@ def forward(self, points: torch.Tensor) -> torch.Tensor:
505
514
# voxel size and translation.
506
515
voxel_size = self .extents ,
507
516
volume_translation = self .translation ,
517
+ # pyre-fixme[29]: `Union[BoundMethod[typing.Callable(torch._C._TensorBase...
508
518
device = next (self .params .values ()).device ,
509
519
)
520
+ # pyre-fixme[29]: `Union[torch._tensor.Tensor,
521
+ # torch.nn.modules.module.Module]` is not a function.
510
522
grid_values = self .voxel_grid .values_type (** self .params )
511
523
# voxel grids operate with extra n_grids dimension, which we fix to one
512
524
return self .voxel_grid .evaluate_world (points [None ], grid_values , locator )[0 ]
0 commit comments