Skip to content

Commit 33cc12b

Browse files
LukeWoodtensorflower-gardener
authored andcommitted
Update tensorflow_probability/python/experimental/composite_tensor_test to no longer rely on keras 1D->2D data upranking. We are planning to remove this behavior from the keras codebase. We are fixing various broken tests to minimize the impact of this breaking change.
PiperOrigin-RevId: 386077305
1 parent 57fa903 commit 33cc12b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorflow_probability/python/experimental/composite_tensor_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,11 +421,11 @@ def layer_helper(x):
421421

422422
model1.compile(optimizer='sgd', loss='mean_squared_error')
423423
model2.compile(optimizer='sgd', loss='mean_squared_error')
424-
xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0])
424+
xs = np.expand_dims(np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0]), axis=-1)
425425
ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0])
426426
model1.fit(xs, ys, epochs=500)
427427
model2.fit(xs, ys, epochs=500, steps_per_epoch=5)
428-
x_test = np.array([10.0])
428+
x_test = np.expand_dims(np.array([10.0]), axis=-1)
429429
model1.predict(x_test, steps=1)
430430
model2.predict(x_test, steps=1)
431431

0 commit comments

Comments
 (0)