Overriding Layer.forward
unexpectedly changes the signature of Layer.__call__
under torch backend
#19730
Labels
To investigate
Looks like a bug. It needs someone to investigate.
In torch, one typically writes layer
__call__
methods by overriding theforward
method. Under keras, we instead use thecall
method.I would not expect overriding
forward
to have any effect on how akeras.Layer
is called, even under the torch backend, since this is the purpose ofcall
. However, it seems when theforward
method is overridden, this takes priority over overridingLayer.call
.Minimal Example:
My keras version: 3.3.3
The text was updated successfully, but these errors were encountered: