#' @export
detach_grad<-function(x)
{
# --- this is a bit of a hack
x_class = class(x)[1]
if(x_class == 'torch_tensor'){
#x = as_torch_tensor(as_array(x))
x = x$detach()
}
return(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.