Description Usage Arguments Details Examples
If not called immediately on startup risks creating breakage and bugs.
1 2 | tfe_enable_eager_execution(config = NULL, device_policy = c("explicit",
"warn", "silent"))
|
config |
(Optional) A |
device_policy |
(Optional) What policy to use when trying to run an operation on a device with inputs which are not on that device. Valid values: "explicit": raises an error if the placement is not correct. "warn": copies the tensors which are not on the right device but raises a warning. "silent": silently copies the tensors. This might hide performance problems. |
After eager execution is enabled, operations are executed as they are
defined and tensors hold concrete values, and can be accessed as R matrices
or arrays with as.matrix(), as.array(), as.double(), etc.
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## Not run:
# load tensorflow and enable eager execution
library(tensorflow)
tfe_enable_eager_execution()
# create a random 10x10 matrix
x <- tf$random_normal(shape(10, 10))
# use it in R via as.matrix()
heatmap(as.matrix(x))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.