Add training mode

This commit is contained in:
babysor00
2022-05-03 10:24:39 +08:00
parent 70cc3988d3
commit 96993a5c61
9 changed files with 178 additions and 28 deletions

View File

@@ -42,3 +42,9 @@ def human_format(num):
# add more suffixes if you need them
return '{:3.1f}{}'.format(num, [' ', 'K', 'M', 'G', 'T', 'P'][magnitude])
# provide easy access of attribute from dict, such abc.key
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self