inst/inst__nn_modules__general/nn_module__nn_unsqueeze.R

nn_unsqueeze <- torch::nn_module(
  classname = "nn_unsqueeze",
  # --- init
  initialize = function(dim = 2,
                        ...) {
    # --- spec
    self$dim = dim

  },
  # --- forward:
  forward = function(x,...) {

    # --- perform unsqueeze
    x = x$unsqueeze(self$dim)
    return(x)

  }
)
adsb85/lqp documentation built on April 9, 2022, 12:35 a.m.