<std::runtime_error/C++Error/error/condition>
Error in `torch_tensor_cpp(data, dtype, device, requires_grad, pin_memory)`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.

test_that("cox_loss returns scalar tensor", {
status <- torch_tensor(sample(0:1, 20, replace = TRUE))
y <- torch_stack(list(time, status), dim = 2)
test_that("cox_l2_loss returns penalized scalar tensor", {
loss <- cox_l2_loss(pred, y, lambda = 0.01)
test_that("aft_loss returns scalar tensor (uncensored only)", {
test_that("aft_loss returns 0 for fully censored data", {
test_that("coxtime_loss implements partial likelihood faithfully", {
true <- torch_cat(list(time, status), dim = 2)

"cox_l2_loss returns penalized scalar tensor"
"aft_loss returns scalar tensor (uncensored only)"
"aft_loss returns 0 for fully censored data"
"coxtime_loss implements partial likelihood faithfully"

cox_l2_loss returns penalized scalar tensor

aft_loss returns scalar tensor (uncensored only)

aft_loss returns 0 for fully censored data

<std::runtime_error/C++Error/error/condition>
Error in `(function (size, options) 
{
    .Call(`_torch_cpp_torch_namespace_randn_size_IntArrayRef`, 
        size, options)
})(size = c(50, 1), options = list(dtype = NULL, layout = NULL, 
    device = NULL, requires_grad = FALSE))`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.

coxtime_loss implements partial likelihood faithfully