Skip to content

Commit 7099d3e

Browse files
committed
Fix tests broken by 2.7.0rc1
- batch dimensions are no longer automatically expanded by predict(). - layer_cropping_1d() is more strict now, does not implicitly allow for a dimension of size 0 to be returned.
1 parent 223d63f commit 7099d3e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

tests/testthat/test-Layer.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test_succeeds("Can use custom layers in sequential models", {
5555
layer_multiply_by_x(2) %>%
5656
layer_multiply_by_x(2)
5757

58-
out <- predict(model, c(1,2,3,4,5))
58+
out <- predict(model, matrix(c(1,2,3,4,5), ncol = 1))
5959

6060
expect_equal(out, matrix(1:5, ncol = 1)*2*2)
6161
})

tests/testthat/test-layers.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ test_call_succeeds("layer_zero_padding_3d", {
257257
test_call_succeeds("layer_cropping_1d", {
258258
skip_if_cntk() # crashes CNTK
259259
keras_model_sequential() %>%
260-
layer_dense(32, input_shape = c(784)) %>%
261-
layer_reshape(target_shape = c(2,16)) %>%
260+
layer_dense(64, input_shape = c(784)) %>%
261+
layer_reshape(target_shape = c(4,16)) %>%
262262
layer_cropping_1d()
263263
})
264264

tools/check1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export TF_CPP_MIN_LOG_LEVEL=2
1111

1212

1313

14-
TMPDIR="/tmp/r-keras-tests/tf-2.6-cpu/"
14+
TMPDIR="/tmp/r-keras-tests/tf-2.7-cpu/"
1515
mkdir -p $TMPDIR
1616
rsync -a --delete . $TMPDIR
1717

tools/setup-test-envs.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ args <- commandArgs(TRUE)
55
if("--fresh" %in% args) # fresh start
66
unlink(reticulate::miniconda_path(), recursive = TRUE)
77

8-
tf_vers <- c("2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7.0rc0", "nightly")
8+
tf_vers <- c("2.1", "2.2", "2.3", "2.4", "2.5", "2.6", "2.7.0rc1", "nightly")
99
tf_vers <- paste0(tf_vers, "-cpu")
1010
py_vers <- c("3.6", "3.6", "3.7", "3.8", "3.8", "3.9", "3.9", "3.9")
1111

0 commit comments

Comments
 (0)