Unverified Commit a5116ecd authored by Crutcher Dunnavant's avatar Crutcher Dunnavant Committed by GitHub
Browse files

Workhandle as dataclass (#1008)

parent 96fcc1ca
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment