Browse Source

[fix] EchoCallback

tags/v0.4.10
yunfan 5 years ago
parent
commit
1c2ee50c47
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      fastNLP/core/callback.py

+ 2
- 3
fastNLP/core/callback.py View File

@@ -1031,12 +1031,11 @@ class EchoCallback(Callback):
def __init__(self, name, out=sys.stdout):
super(EchoCallback, self).__init__()
self.name = name
self.out = out
self.out = out # deprecated

def __getattribute__(self, item):
if item.startswith('on_'):
logger.info('{}.{} has been called at pid: {}'.format(self.name, item, os.getpid()),
file=self.out)
logger.info('{}.{} has been called at pid: {}'.format(self.name, item, os.getpid()))
return super(EchoCallback, self).__getattribute__(item)




Loading…
Cancel
Save