inst/inst__nn_modules__constant/nn_module__nn_constant.R

nn_constant <- torch::nn_module(
  classname = "nn_constant",
  # --- init
  initialize = function(value,
                        ...){
    #holds a single constant
    self$constant = value

  },
  # --- forward
  forward = function(...) {
    self$constant
  }
)
adsb85/lqp documentation built on April 9, 2022, 12:35 a.m.