Open rizar opened 9 years ago
That looks nicer.
"That" is with decorator or without?
With the decorator.
OK, then I will just put CCW label on that since it is not urgent.
Yet another argument in favour of a separate decorator is ability to inherit from Activation
but without copying the docs, see #798
See https://github.com/mila-udem/blocks/blob/master/blocks/bricks/__init__.py#L432
It is justified by http://bugs.python.org/issue12773 in the code, but in fact docstrings are mutable for classes with non-trivial metaclasses. Taking that into account, I would rather use decorators for the purpose of adding docs as a more standard tool will more predictable consequences (e.g. one can only change the metaclass of any descendant of e.g.
Tanh
to subclasses ofActivationDocumentation
, which I found inconvenient).Switching to a decorator here would make the code look like
that is one extra line for each activation.