if (rlang::is_installed("torch") && torch::torch_is_installed()) {
tensors <- list(x = torch::torch_randn(10, 10))
temp <- tempfile()
safe_save_file(tensors, temp)
safe_load_file(temp)
ser <- safe_serialize(tensors)
}
Run the code above in your browser using DataLab