diff --git a/celldetection/ops/boxes.py b/celldetection/ops/boxes.py index b1472cc..333fa76 100644 --- a/celldetection/ops/boxes.py +++ b/celldetection/ops/boxes.py @@ -10,16 +10,16 @@ __all__ = ['nms', 'contours2boxes', 'pairwise_box_iou', 'pairwise_generalized_box_iou', 'filter_by_box_voting'] -def no_decorator(*args, **kwargs): +def torch_compile(*args, **kwargs): def decorator(func): - return func + if WINDOWS: + return func # compile not supported on Windows, yet + else: + return torch.compile(func, *args, **kwargs) return decorator -torch_compile = (no_decorator if WINDOWS else torch.compile) # TODO: Remove when torch.compile is supports on Windows - - @torch_compile(dynamic=True) def nms(boxes, scores, thresh=.5) -> torch.Tensor: """Non-maximum suppression.