| ag_local_mode | R Documentation |
Sets graph mode (ag_graph_mode) and/or matrix-multiply
precision (ag_matmul_precision) and restores the previous
values when the calling function exits – normally or by an error. One place
for both, instead of a pair of on.exit calls per setting.
ag_local_mode(graph = NULL, matmul_precision = NULL, envir = parent.frame())
graph |
|
matmul_precision |
|
envir |
The frame whose exit restores the settings (the caller's). |
The previous values, invisibly.
f <- function() {
ag_local_mode(graph = TRUE, matmul_precision = "f32")
c(ag_graph_mode(), ag_matmul_precision())
}
f() # TRUE "f32"
ag_graph_mode() # back to the previous value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.