Eng/distributed training (#27)

* added checkpointing logic

* small nits
This commit is contained in:
evonneng authored and GitHub committed 2022-04-20 12:06:29 -07:00
1 parent ba7a2c33c4
commit bf3b77f952
3 files changed
+62 -31

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
"""
Decorator definitions
"""
from typing import Callable
def check_main_thread(func: Callable) -> Callable:
"""Declarator: check if you are on main thread"""
def wrapper(self, *args, **kwargs):
if self.is_main_thread:
func(self, *args, **kwargs)
return wrapper