-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
code reviewCode review or commentCode review or commentenhancementNew feature or requestNew feature or requesttodoNew task or assignmentNew task or assignment
Milestone
Description
Problem
Profiling inspect() with py-spy reveals that torch.unique() at line 243 consumes ~37% of total execution time. For 3D medical images like BRaTS (240x240x155), this operation scans the entire label volume for each sample.
The ids field is rarely used in practice - only referenced in documentation examples. Most training pipelines (ROIDataset, RandomROIDataset) never access this field, making the 37% overhead unnecessary.
Proposed Solution
Add compute_ids: bool = True parameter to inspect(), allowing users to skip the expensive unique() call. When False, set ids to None (requires changing type to tuple[int, ...] | None).
Metadata
Metadata
Assignees
Labels
code reviewCode review or commentCode review or commentenhancementNew feature or requestNew feature or requesttodoNew task or assignmentNew task or assignment