Skip to content

Commit 25bc475

Browse files
Merge pull request #1386 from Frightera:frighterafix#1384
PiperOrigin-RevId: 390247581
2 parents 0867ae3 + 63501a0 commit 25bc475

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tensorflow_probability/python/layers/conv_variational.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def _apply_variational_bias(self, inputs):
381381
# As of Mar 2017, direct addition is significantly slower than
382382
# bias_add when computing gradients. To use bias_add, we collapse Z
383383
# and Y into a single dimension to obtain a 4D input tensor.
384-
outputs_shape = outputs.shape.as_list()
384+
outputs_shape = tf.shape(outputs)
385385
outputs_4d = tf.reshape(outputs,
386386
[outputs_shape[0], outputs_shape[1],
387387
outputs_shape[2] * outputs_shape[3],

tensorflow_probability/python/layers/conv_variational_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,8 @@ def _testLayerInSequential(self, layer_class): # pylint: disable=invalid-name
609609
outputs = self.maybe_transpose_tensor(outputs)
610610

611611
net = tf.keras.Sequential([
612-
layer_class(filters=2, kernel_size=3, data_format=self.data_format),
612+
layer_class(filters=2, kernel_size=3, data_format=self.data_format,
613+
input_shape=inputs.shape[1:]),
613614
layer_class(filters=2, kernel_size=1, data_format=self.data_format)])
614615

615616
net.compile(loss='mse', optimizer='adam')

0 commit comments

Comments
 (0)