Commit ed7dfd66 authored by Tom Hennigan's avatar Tom Hennigan Committed by TensorFlower Gardener
Browse files

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
parent 15bf2dd1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment