Skip to content

Commit

Permalink
Add guard clause to prevent module execution on import
Browse files Browse the repository at this point in the history
  • Loading branch information
fcogidi committed Jan 23, 2024
1 parent fb47cd3 commit 6d28c91
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ def all_gather(self, data: torch.Tensor) -> List[torch.Tensor]: # type: ignore[
slice_param = [slice(dim_size) for dim_size in item_size]
gathered_data[idx] = gathered_data[idx][slice_param]
return gathered_data


if __name__ == "__main__": # prevent execution of module on import
pass

0 comments on commit 6d28c91

Please sign in to comment.