torch icon indicating copy to clipboard operation
torch copied to clipboard

Training mode is not persisted after tracing

Open dfalbel opened this issue 4 years ago • 0 comments

library(torch)
model <- nn_sequential(
  nn_linear(10, 10),
  nn_relu(),
  nn_dropout(),
  nn_linear(10, 1)
)

model$eval()
model$training
#> [1] FALSE
test_model <- jit_trace(model, torch_randn(10, 10)) 
test_model$training
#> [1] TRUE

I think this is related to #620

dfalbel avatar Aug 02 '21 12:08 dfalbel