[4fa73e]: / pytorch / datasets / __init__.py

Download this file

11 lines (8 with data), 394 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
import os
import sys
path = os.path.dirname(os.path.abspath(__file__))
for py in [f[:-3] for f in os.listdir(path) if f.endswith('.py') and f != '__init__.py']:
mod = __import__('.'.join([__name__, py]), fromlist=[py])
classes = [getattr(mod, x) for x in dir(mod) if isinstance(getattr(mod, x), type)]
for cls in classes:
setattr(sys.modules[__name__], cls.__name__, cls)