File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 55# ' with previous versions. For instance, this is useful to run TensorFlow 1.x
66# ' code when using TensorFlow 2.x.
77# '
8- # ' @inheritParams reticulate py_set_seed
9- # '
10- # ' @param version The version to activate.
8+ # ' @param version The version to activate. Must be `"v1"` or `"v2"`
119# '
1210# ' @examples
1311# ' \dontrun{
1614# ' }
1715# '
1816# ' @export
19- use_compat <- function (version = c(" v1" )) {
20- if (identical(tf_version(), NULL ) || tf_version() < " 2.0 " ) return ()
17+ use_compat <- function (version = c(" v1" , " v2 " )) {
18+ if (identical(tf_version(), NULL )) return ()
2119
22- # validate method
2320 version <- match.arg(version )
2421
2522 tf2 <- tf
2623
27- # disable eager execution to match v1 default
28- tf2 $ compat $ v1 $ disable_eager_execution()
29-
3024 unlock <- get(" unlockBinding" )
3125 lock <- get(" lockBinding" )
3226
You can’t perform that action at this time.
0 commit comments