mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 13:59:10 +08:00
removed stats tracker; consolidate writers into local writer
This commit is contained in:
1 parent
4dee65b480
commit
59eeaca93b
9 files changed
+248
-316
No files matched your search
@@ -19,24 +19,12 @@ def decorate_all(decorators: List[Callable]) -> Callable:
|
||||
return decorate
|
||||
|
||||
|
||||
def check_stats_enabled(func: Callable) -> Callable:
|
||||
"""Decorator: check if stats tracker is enabled"""
|
||||
|
||||
def wrapper(self, *args, **kwargs):
|
||||
ret = None
|
||||
if self.config.logging.enable_stats:
|
||||
ret = func(self, *args, **kwargs)
|
||||
return ret
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
def check_profiler_enabled(func: Callable) -> Callable:
|
||||
"""Decorator: check if profiler is enabled"""
|
||||
|
||||
def wrapper(self, *args, **kwargs):
|
||||
ret = None
|
||||
if self.config.enable_stats:
|
||||
if self.config.enable_profiler:
|
||||
ret = func(self, *args, **kwargs)
|
||||
return ret
|
||||
|
||||
@@ -46,26 +34,10 @@ def check_profiler_enabled(func: Callable) -> Callable:
|
||||
def check_main_thread(func: Callable) -> Callable:
|
||||
"""Decorator: check if you are on main thread"""
|
||||
|
||||
def wrapper(self, *args, **kwargs):
|
||||
def wrapper(*args, **kwargs):
|
||||
ret = None
|
||||
if comms.is_main_process():
|
||||
ret = func(self, *args, **kwargs)
|
||||
return ret
|
||||
|
||||
return wrapper
|
||||
|
||||
|
||||
def check_print_stats_step(func: Callable) -> Callable:
|
||||
"""Decorator: check if it is time to print stats update"""
|
||||
|
||||
def wrapper(self, *args, **kwargs):
|
||||
ret = None
|
||||
if (
|
||||
self.step % self.config.logging.steps_per_log == 0
|
||||
or (self.config.graph.steps_per_save and self.step % self.config.graph.steps_per_save == 0)
|
||||
or self.step % self.config.graph.steps_per_test == 0
|
||||
):
|
||||
ret = func(self, *args, **kwargs)
|
||||
ret = func(*args, **kwargs)
|
||||
return ret
|
||||
|
||||
return wrapper
|
||||
Reference in new issue
Block a user