-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Speed up mask sampling with rejection sampling (#2585)
* change masked pixel sampling to use rejection sampling instead of torch.nonzero * black reformat code * pyright unbound variable num_valid * pyright type issues with num_valid * add configuration settings for rejection sampling masks * black reformat * maybe this fixes it? * revert behavior if mask sampling failed, still raise warning * on iteration failure, use non-rejection sampling to generate indices * ruff --------- Co-authored-by: adrian_chang <[email protected]> Co-authored-by: Alexander Kristoffersen <[email protected]>
- Loading branch information
1 parent
15e81d3
commit a78ca29
Showing
1 changed file
with
42 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters