Why just not return one of the implementations, say backend.nn.silu in class Swish? Or it would be better if it is possible to use the export decorator like this:
Yes, you are right. There is no need for the duplication, we can just export API aliases. I've consolidated everything under silu (since the name predates swish).
Currently in
ops.nn.py
there are two identical implementations for silu and swish (which are the same things):https://github.com/keras-team/keras-core/blob/d40529efb31f6759699318bfb76927505bd95f76/keras_core/ops/nn.py#L181-L226
https://github.com/keras-team/keras-core/blob/d40529efb31f6759699318bfb76927505bd95f76/keras_core/backend/numpy/nn.py#L39-L44
Why just not return one of the implementations, say
backend.nn.silu
inclass Swish
? Or it would be better if it is possible to use the export decorator like this:In
(ops.nn.py)
: