Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
a5116ecd
Unverified
Commit
a5116ecd
authored
Jun 28, 2022
by
Crutcher Dunnavant
Committed by
GitHub
Jun 28, 2022
Browse files
Workhandle as dataclass (#1008)
parent
96fcc1ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
fairscale/internal/params.py
fairscale/internal/params.py
+4
-3
No files found.
fairscale/internal/params.py
View file @
a5116ecd
...
...
@@ -4,6 +4,7 @@
# LICENSE file in the root directory of this source tree.
import
collections.abc
as
abc
from
dataclasses
import
dataclass
from
math
import
inf
from
typing
import
Any
,
Callable
,
Dict
,
List
,
Optional
...
...
@@ -11,10 +12,10 @@ import torch
import
torch.distributed
as
dist
@
dataclass
class
Workhandle
:
def
__init__
(
self
,
handle
:
Any
,
callback
:
Optional
[
Callable
])
->
None
:
self
.
handle
=
handle
self
.
callback
=
callback
handle
:
Any
callback
:
Optional
[
Callable
]
=
None
def
get_global_rank
(
group
:
Any
,
rank
:
int
)
->
int
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment