powered by
Clones a module.
clone_module(module, deep = FALSE, ..., replace_values = TRUE)
(nn_module) The module to clone
nn_module
(logical(1)) Whether to create a deep clone.
logical(1)
(any) Additional parameters, currently unused.
(logical(1)) Whether to replace parameters and buffers with the cloned values.
if (torch_is_installed()) { clone_module(nn_linear(1, 1), deep = TRUE) # is the same as nn_linear(1, 1)$clone(deep = TRUE) }
Run the code above in your browser using DataLab