mlverse / torch

R Interface to Torch
https://torch.mlverse.org
Other
483 stars 66 forks source link

cloning nn_module changes type of object #1117

Closed sebffischer closed 6 months ago

sebffischer commented 8 months ago

compare nn_module with nn_Module

library(torch)
#> Warning: package 'torch' was built under R version 4.3.1

class(nn_linear(10, 1)$clone(deep = TRUE))
#> [1] "nn_linear" "nn_Module" "R6"
class(nn_linear(10, 1))
#> [1] "nn_linear" "nn_module"

Created on 2023-11-03 with reprex v2.0.2