nn_constant <- torch::nn_module(
classname = "nn_constant",
# --- init
initialize = function(value,
...){
#holds a single constant
self$constant = value
},
# --- forward
forward = function(...) {
self$constant
}
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.