Bug report
keras.layers.SeparableConv1D computes a correct output shape for eager tensors, but the symbolic output shape from keras.Input() is wrong when using padding='valid' and strides > 1.
Reproduction
import keras
import tensorflow as tf
import numpy as np
x_eager = tf.constant(np.random.rand(4, 10, 12), dtype=tf.float32)
x_sym = keras.Input(shape=(10, 12))
layer = keras.layers.SeparableConv1D(64, 11, strides=5, padding='valid', activation='relu')
y_eager = layer(x_eager)
y_sym = layer(x_sym)
print(y_eager.shape)
print(y_sym.shape)
Expected result
Both outputs should report the same spatial shape.
Actual result
- Eager output shape:
(4, 10, 64)
- Symbolic output shape:
(None, 0, 64)
This indicates incorrect static shape inference for SeparableConv1D.
Bug report
keras.layers.SeparableConv1Dcomputes a correct output shape for eager tensors, but the symbolic output shape fromkeras.Input()is wrong when usingpadding='valid'andstrides > 1.Reproduction
Expected result
Both outputs should report the same spatial shape.
Actual result
(4, 10, 64)(None, 0, 64)This indicates incorrect static shape inference for
SeparableConv1D.