skip_if_no_torch = function() { skip_if_not_installed("torch") skip_if_not(torch::torch_is_installed(), "Torch backend not available") } test_that("FFNN generator uses torch namespace explicitly", { skip_if_no_torch() expr = ffnn_generator( nn_name = "TestFFNN", hd_neurons = c(10, 5), no_x = 3, no_y = 1, activations = "relu" ) code_str = paste(deparse(expr), collapse = " ") expect_match(code_str, "torch::nn_module", fixed = TRUE) expect_match(code_str, "torch::nn_linear", fixed = TRUE) expect_match(code_str, "torch::nnf_relu", fixed = TRUE) expect_false(grepl("(?