Files
nerfstudio/mattport/utils/decorators.py
T
evonneng bf3b77f952 Eng/distributed training (#27)
* added checkpointing logic

* small nits
2022-04-20 12:06:29 -07:00

15 lines
298 B
Python

"""
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