keras-team / keras-core

A multi-backend implementation of the Keras API, with support for TensorFlow, JAX, and PyTorch.
Apache License 2.0
1.27k stars 115 forks source link

Added dtype to config in Loss. #930

Closed PatReis closed 10 months ago

PatReis commented 10 months ago

Thank you very much for the update in Loss .

I have following question/suggestion, which I hope is okay and does not clash with the saving/loading behaviour of models: I added the dtype information to the config of Loss such that the default floatx behaviour can be maintained even when created from config. If dtype is specified, then the Loss will set dtype from config.

If the dtype should not be passed on to the config then this pull request should be canceled.

PatReis commented 10 months ago

Ah I see, the subclasses and tests do not like dtype in config.