Make tf.Module extend ABCMeta to make abstract subclasses trivial.
```
import abc
class AbstractModule(tf.Module):
@abc.abstractmethod
def __call__(self, inputs, is_training=False):
pass
```
You can do this more verbosely if you prefer:
```
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class AbstractModule(tf.Module):
@abc.abstractmethod
def __call__(self, inputs, is_training=False):
pass
```
PiperOrigin-RevId: 234186396
Loading
Please sign in to comment