Skip to content
Discussion options

You must be logged in to vote

In Keras 3.15.1, the symbolic path now explicitly checks the input channels before inferring the output shape. The TensorFlow backend calls the same validator.

For example, this has three input channels but a kernel expecting four, so it should raise ValueError during symbolic construction:

import keras

x = keras.KerasTensor((None, 8, 8, 3))
kernel = keras.KerasTensor((3, 3, 5, 4))
keras.ops.conv_transpose(x, kernel, data_format="channels_last")

The transposed-convolution kernel layout is (spatial..., output_channels, input_channels), so the comparison uses its last dimension.

The remaining distinction is an unknown channel dimension: the validator only compares two concrete integers. If…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@AkshatRaj00
Comment options

Answer selected by AkshatRaj00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants