R/seed.R

Defines functions tensorflow_on_before_use_session tensorflow_on_use_session

tensorflow_on_before_use_session <- function(quiet) {
  if (is_backend("tensorflow")) {
    keras$backend$clear_session()
    TRUE
  } else {
    FALSE
  }
}

tensorflow_on_use_session <- function(sess, quiet) {
  if (is_backend("tensorflow"))
    keras$backend$set_session(sess)
}
dfalbel/keras documentation built on Nov. 27, 2019, 8:16 p.m.