Skip to content

Commit

Permalink
add distributed property in accelerate_state
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiyuanChen committed Jul 5, 2022
1 parent 6ebddcd commit 6934ac5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/accelerate/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ def __init__(
self.mixed_precision = mixed_precision
self.initialized = True

@property
def distributed(self):
return self.num_processes > 1

def __repr__(self):
mixed_precision = self.mixed_precision

Expand Down

0 comments on commit 6934ac5

Please sign in to comment.