Last chance! 50% off unlimited learning
Sale ends in
script_function
to a pathSaves a script_function
to a path
jit_save(obj, path, ...)
An script_function
to save
The path to save the serialized function.
currently unused
# NOT RUN {
if (torch_is_installed()) {
fn <- function(x) {
torch_relu(x)
}
input <- torch_tensor(c(-1, 0, 1))
tr_fn <- jit_trace(fn, input)
tmp <- tempfile("tst", fileext = "pt")
jit_save(tr_fn, tmp)
}
# }
Run the code above in your browser using DataLab