Closed liruilong940607 closed 1 year ago
It shouldn't affect the performance as the border of the occupancy grid would be learnt to be zero. But the cuda code I'm writting would make sure all points outside the boarder have zero values, which would results slightly different behavior with F.grid_sample
but should be more suitable for our case.
Issue of the F.grid_sample:
padding_mode==zeros
means padding zero voxel values outside the grid. a query point that is slightly outside the grid would be interpolated by the voxel values on the boarder of the grid and the outside zero voxels. So it gives non-zero value at regions slightly outside the grid.Toy code to show:
Relevant code in our code base:
https://github.com/plenoptix/pyrad/blob/91ef54963c43beb34f13301f8496faf2f0de8a2e/pyrad/fields/occupancy_fields/occupancy_grid.py#L131