Skip to content

Commit cd21cae

Browse files
committed
Revert "fixed signatures of decorated functions"
This reverts commit 34fd15f.
1 parent 34fd15f commit cd21cae

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

neural_monitor/monitor.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from imageio import imwrite
1818
from shutil import copyfile
1919
from collections import namedtuple, deque
20+
import functools
2021
import torch.distributed
2122
from typing import (
2223
List,
@@ -29,7 +30,6 @@
2930
)
3031
import pandas as pd
3132
from easydict import EasyDict
32-
from decorator import decorator
3333

3434
try:
3535
import visdom
@@ -184,8 +184,8 @@ def _spawn_defaultdict_ordereddict():
184184
return collections.OrderedDict()
185185

186186

187-
@decorator
188187
def check_path_init(f):
188+
@functools.wraps(f)
189189
def set_default_path(self, *args, **kwargs):
190190
if not self._initialized:
191191
logger.info('Working folder not initialized! Initialize working folder to default.')
@@ -197,19 +197,19 @@ def set_default_path(self, *args, **kwargs):
197197
return set_default_path
198198

199199

200-
@decorator
201200
def standardize_name(f):
201+
@functools.wraps(f)
202202
def func(self, name: str, *args, **kwargs):
203203
if name is not None:
204204
name = name.replace(' ', '-')
205205

206-
return f(self, name, *args, **kwargs)
206+
f(self, name, *args, **kwargs)
207207

208208
return func
209209

210210

211-
@decorator
212211
def distributed_collect(f):
212+
@functools.wraps(f)
213213
def func(self, name: str, value: T.Tensor, *args, **kwargs):
214214
if self.distributed:
215215
assert isinstance(value, T.Tensor), 'value must be a Tensor in distributed mode'
@@ -220,8 +220,8 @@ def func(self, name: str, value: T.Tensor, *args, **kwargs):
220220
return func
221221

222222

223-
@decorator
224223
def distributed_flush(f):
224+
@functools.wraps(f)
225225
def func(self, *args, **kwargs):
226226
if self.distributed and self.rank != 0:
227227
return

requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ tensorboard
88
imageio
99
git-python
1010
pandas
11-
decorator
12-
easydict

setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ def setup_package():
3030
'Programming Language :: Python :: 3.7'
3131
],
3232
platforms=['Windows', 'Linux'],
33-
packages=find_packages(exclude=['docs', 'doc']),
34-
install_requires=['matplotlib', 'numpy', 'imageio', 'tensorboard',
35-
'git-python', 'easydict', 'pandas', 'decorator'],
33+
packages=find_packages(exclude=['docs']),
34+
install_requires=['matplotlib', 'numpy', 'imageio', 'tensorboard', 'git-python', 'easydict', 'pandas'],
3635
project_urls={
3736
'Bug Reports': 'https://github.com/justanhduc/neural-monitor/issues',
3837
'Source': 'https://github.com/justanhduc/neural-monitor',

0 commit comments

Comments
 (0)