keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.06k stars 19.35k forks source link

Return a tuple from `ops.shape` with the Torch backend. #19640

Closed hertschuh closed 2 weeks ago

hertschuh commented 2 weeks ago

With Torch, x.shape returns a torch.Size, which is a subclass of tuple but can cause different behaviors. In particular convert_to_tensor does not work on torch.Size.

This fixes https://github.com/keras-team/keras/issues/18900