Jeremy Reizenstein 305cf32f6b Avoid raysampler dict
Summary:
A significant speedup (e.g. >2% of a forward pass).

Move NDCMultinomialRaysampler parts of AbstractMaskRaySampler to members instead of living in a dict. The dict was hiding them from the nn.Module system so their _xy_grid members were remaining on the CPU. Therefore they were being copied to the GPU in every forward pass.

(We couldn't easily use a ModuleDict here because the enum keys are not strs.)

Reviewed By: shapovalov

Differential Revision: D39668589

fbshipit-source-id: 719b88e4a08fd7263a284e0ab38189e666bd7e3a
2022-09-21 04:29:44 -07:00
..
2022-09-21 04:29:44 -07:00
2022-06-24 04:18:01 -07:00
2022-03-24 07:04:38 -07:00
2022-08-02 15:40:53 -07:00
2022-07-13 06:07:02 -07:00