Skip to content

Commit

Permalink
Add a test case for keras.layers.Convolution3DTranspose to verify zer…
Browse files Browse the repository at this point in the history
…o input shape does not raise errors

PiperOrigin-RevId: 487289971
  • Loading branch information
panzhufeng authored and tensorflower-gardener committed Nov 9, 2022
1 parent 29f5006 commit 85db5d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions keras/layers/convolutional/conv_test.py
Expand Up @@ -448,6 +448,12 @@ def test_conv3d_invalid_output_shapes(self):
layer = keras.layers.Conv3D(**kwargs)
layer.build((None, 5, 5, 5, 2))

def test_conv3d_zero_dim_output(self):
conv = keras.layers.Convolution3DTranspose(2, [3, 3, 3], padding="same")
x = tf.random.uniform([1, 32, 32, 0, 3], dtype=tf.float32)
# The layer doesn't crash with 0 dim input
_ = conv(x)


@test_combinations.run_all_keras_modes(always_skip_v1=True)
class GroupedConvTest(test_combinations.TestCase):
Expand Down

0 comments on commit 85db5d0

Please sign in to comment.