autodl-projects/lib/layers/super_module.py

18 lines
488 B
Python
Raw Normal View History

2021-03-18 09:02:55 +01:00
#####################################################
# Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2021.01 #
#####################################################
import abc
2021-03-17 11:06:29 +01:00
import torch.nn as nn
2021-03-18 09:02:55 +01:00
class SuperModule(abc.ABCMeta, nn.Module):
"""This class equips the nn.Module class with the ability to apply AutoDL."""
def __init__(self):
super(SuperModule, self).__init__()
@abc.abstractmethod
def abstract_search_space(self):
raise NotImplementedError