Skip to content

Commit 3316c86

Browse files
authored
Merge pull request #656 from rstudio/is_tensorflow_dataset_fix
generalize to accommodate other underlying python classes
2 parents 16991d3 + 87b85d5 commit 3316c86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/model.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,8 @@ is_main_thread_generator.keras_preprocessing.image.Iterator <- function(x) {
973973
}
974974

975975
is_tensorflow_dataset <- function(x) {
976-
inherits(x, "tensorflow.python.data.ops.dataset_ops.Dataset")
976+
inherits(x, "tensorflow.python.data.ops.dataset_ops.DatasetV2") ||
977+
inherits(x, "tensorflow.python.data.ops.dataset_ops.Dataset")
977978
}
978979

979980
resolve_tensorflow_dataset <- function(x) {

0 commit comments

Comments
 (0)