Running 'testthat.R' [39s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(causalOT)
  > 
  > test_check("causalOT")
  [ FAIL 22 | WARN 1 | SKIP 30 | PASS 123 ]
  
  ══ Skipped tests (30) ══════════════════════════════════════════════════════════
  • On CRAN (30): 'test-OTmethod.R:28:3', 'test-OTmethod.R:97:3',
    'test-OTmethod.R:195:3', 'test-OTmethod.R:246:3', 'test-OTmethod.R:295:3',
    'test-OTmethod.R:392:3', 'test-OTmethod.R:477:3', 'test-OTmethod.R:519:3',
    'test-OTmethod.R:566:3', 'test-PSIS.R:2:3', 'test-PSIS.R:34:3',
    'test-PSIS.R:66:3', 'test-barycentric_projection.R:3:3',
    'test-barycentric_projection.R:92:3', 'test-barycentric_projection.R:182:3',
    'test-costMethod.R:50:3', 'test-cotClass.R:2:3', 'test-cotClass.R:64:3',
    'test-cotClass.R:118:3', 'test-cotClass.R:188:3', 'test-cotClass.R:219:3',
    'test-cotClass.R:323:3', 'test-cotClass.R:366:3', 'test-cotOOP.R:2:3',
    'test-cotOOP.R:110:3', 'test-cotOOP.R:237:3', 'test-cotOOP.R:361:3',
    'test-estimate_effect.R:3:3', 'test-estimate_effect.R:77:3',
    'test-estimate_effect.R:135:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-OTmethod.R:14:3'): OT object forms tensor ──────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-OTmethod.R:14:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. └─causalOT:::OT$new(...)
   10.   └─causalOT (local) initialize(...)
   11.     └─torch::cuda_is_available()
   12.       └─torch:::cpp_cuda_is_available()
  ── Error ('test-OTmethod.R:74:3'): sinkhorn_loop runs, tensor ──────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT:::OT$new(...) at test-OTmethod.R:74:3
   2.   └─causalOT (local) initialize(...)
   3.     └─torch::cuda_is_available()
   4.       └─torch:::cpp_cuda_is_available()
  ── Error ('test-OTmethod.R:175:3'): sinkhorn_self runs, tensor ─────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT:::OT$new(...) at test-OTmethod.R:175:3
   2.   └─causalOT (local) initialize(...)
   3.     └─torch::cuda_is_available()
   4.       └─torch:::cpp_cuda_is_available()
  ── Error ('test-OTmethod.R:361:3'): sinkhorn_dist runs, tensor ─────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT:::OT$new(...) at test-OTmethod.R:361:3
   2.   └─causalOT (local) initialize(...)
   3.     └─torch::cuda_is_available()
   4.       └─torch:::cpp_cuda_is_available()
  ── Error ('test-OTmethod.R:454:3'): sinkhorn_loop runs, tensor ─────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT:::OT$new(...) at test-OTmethod.R:454:3
   2.   └─causalOT (local) initialize(...)
   3.     └─torch::cuda_is_available()
   4.       └─torch:::cpp_cuda_is_available()
  ── Error ('test-calc_weight.R:14:3'): calc_weight works ────────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. └─causalOT::calc_weight(...) at test-calc_weight.R:14:3
    2.   └─causalOT:::cotProblem(data, estimand, method, options)
    3.     └─causalOT:::gridSearch(data, estimand, method, options)
    4.       ├─methods::new(...)
    5.       │ ├─methods::initialize(value, ...)
    6.       │ └─methods::initialize(value, ...)
    7.       └─causalOT:::gridSearch(data, estimand = "ATE.C", method, options)
    8.         └─causalOT:::balanceDistributions(...)
    9.           ├─base::do.call(cotOptions, options)
   10.           └─causalOT (local) `<fn>`(NULL)
   11.             └─causalOT:::cuda_device_check(device)
   12.               └─torch::cuda_is_available()
   13.                 └─torch:::cpp_cuda_is_available()
  ── Error ('test-costMethod.R:15:3'): costTensor class forms ────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_torch_float64()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-costMethod.R:15:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. └─causalOT:::costTensor$new(x = x, y = y, p = 2L)
   10.   └─causalOT (local) initialize(...)
   11.     └─self$fun(x, y, p)
   12.       ├─torch::torch_tensor(x1, dtype = torch::torch_double())
   13.       │ └─Tensor$new(data, dtype, device, requires_grad, pin_memory)
   14.       │   └─methods$initialize(NULL, NULL, ...)
   15.       │     └─torch:::torch_tensor_cpp(...)
   16.       └─torch::torch_double()
   17.         ├─torch_dtype$new(cpp_torch_float64())
   18.         │ └─methods$initialize(NULL, NULL, ...)
   19.         └─torch:::cpp_torch_float64()
  ── Error ('test-costMethod.R:115:3'): cost function forms appropriate classes ──
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_torch_float64()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-costMethod.R:115:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. └─causalOT:::cost(x = x, y = y, p = 2L)
   10.   └─costTensor$new(x, y, p = p, cost_function = cost_function)
   11.     └─causalOT (local) initialize(...)
   12.       └─self$fun(x, y, p)
   13.         ├─torch::torch_tensor(x1, dtype = torch::torch_double())
   14.         │ └─Tensor$new(data, dtype, device, requires_grad, pin_memory)
   15.         │   └─methods$initialize(NULL, NULL, ...)
   16.         │     └─torch:::torch_tensor_cpp(...)
   17.         └─torch::torch_double()
   18.           ├─torch_dtype$new(cpp_torch_float64())
   19.           │ └─methods$initialize(NULL, NULL, ...)
   20.           └─torch:::cpp_torch_float64()
  ── Error ('test-cotProblem.R:123:3'): cotProblem COT ───────────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_silent(...) at test-cotProblem.R:123:3
    2. │ └─testthat:::quasi_capture(enquo(object), NULL, evaluate_promise)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ ├─withr::with_output_sink(...)
    5. │   │ │ └─base::force(code)
    6. │   │ ├─base::withCallingHandlers(...)
    7. │   │ └─base::withVisible(code)
    8. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    9. ├─testthat::expect_warning(...)
   10. │ └─testthat:::quasi_capture(...)
   11. │   ├─testthat (local) .capture(...)
   12. │   │ └─base::withCallingHandlers(...)
   13. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   14. └─causalOT:::cotProblem(...)
   15.   └─causalOT:::gridSearch(data, estimand, method, options)
   16.     └─causalOT:::balanceDistributions(...)
   17.       ├─base::do.call(cotOptions, options)
   18.       └─causalOT (local) `<fn>`(niter = 2L, nboot = 2, debias = TRUE, torch.optimizer = `<optm_lbf>`)
   19.         └─causalOT:::cuda_device_check(device)
   20.           └─torch::cuda_is_available()
   21.             └─torch:::cpp_cuda_is_available()
  ── Error ('test-cotProblem.R:146:3'): cotProblem NNM ───────────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-cotProblem.R:146:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─causalOT:::cotProblem(...)
    7.   └─causalOT:::gridSearch(data, estimand, method, options)
    8.     └─causalOT:::balanceDistributions(...)
    9.       ├─base::do.call(cotOptions, options)
   10.       └─causalOT (local) `<fn>`(niter = 2L, nboot = 2, debias = TRUE, torch.optimizer = `<optm_lbf>`)
   11.         └─causalOT:::cuda_device_check(device)
   12.           └─torch::cuda_is_available()
   13.             └─torch:::cpp_cuda_is_available()
  ── Error ('test-dual_opts.R:10:3'): test forward functions ─────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::Measure(x, target.values = colMeans(z), adapt = "weights") at test-dual_opts.R:10:3
   2.   └─Measure_$new(...)
   3.     └─causalOT (local) initialize(...)
   4.       └─causalOT:::cuda_device_check(device)
   5.         └─torch::cuda_is_available()
   6.           └─torch:::cpp_cuda_is_available()
  ── Error ('test-dual_opts.R:159:3'): dual nn modules work as expected ──────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::Measure(x, target.values = colMeans(z), adapt = "weights") at test-dual_opts.R:159:3
   2.   └─Measure_$new(...)
   3.     └─causalOT (local) initialize(...)
   4.       └─causalOT:::cuda_device_check(device)
   5.         └─torch::cuda_is_available()
   6.           └─torch:::cpp_cuda_is_available()
  ── Error ('test-dual_opts.R:294:3'): training function works for dual optimizer ──
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::Measure(x, target.values = colMeans(z), adapt = "weights") at test-dual_opts.R:294:3
   2.   └─Measure_$new(...)
   3.     └─causalOT (local) initialize(...)
   4.       └─causalOT:::cuda_device_check(device)
   5.         └─torch::cuda_is_available()
   6.           └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:210:3'): estimate effect works lm, ATT ───────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:210:3
   2.   └─causalOT:::cotProblem(data, estimand, method, options)
   3.     └─causalOT:::gridSearch(data, estimand, method, options)
   4.       └─causalOT:::balanceDistributions(...)
   5.         ├─base::do.call(cotOptions, options)
   6.         └─causalOT (local) `<fn>`(NULL)
   7.           └─causalOT:::cuda_device_check(device)
   8.             └─torch::cuda_is_available()
   9.               └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:372:3'): estimate effect works lm, ATC ───────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:372:3
   2.   └─causalOT:::cotProblem(data, estimand, method, options)
   3.     └─causalOT:::gridSearch(data, estimand, method, options)
   4.       └─causalOT:::balanceDistributions(...)
   5.         ├─base::do.call(cotOptions, options)
   6.         └─causalOT (local) `<fn>`(NULL)
   7.           └─causalOT:::cuda_device_check(device)
   8.             └─torch::cuda_is_available()
   9.               └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:523:3'): estimate effect works lm, ATE ───────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:523:3
    2.   └─causalOT:::cotProblem(data, estimand, method, options)
    3.     └─causalOT:::gridSearch(data, estimand, method, options)
    4.       ├─methods::new(...)
    5.       │ ├─methods::initialize(value, ...)
    6.       │ └─methods::initialize(value, ...)
    7.       └─causalOT:::gridSearch(data, estimand = "ATE.C", method, options)
    8.         └─causalOT:::balanceDistributions(...)
    9.           ├─base::do.call(cotOptions, options)
   10.           └─causalOT (local) `<fn>`(NULL)
   11.             └─causalOT:::cuda_device_check(device)
   12.               └─torch::cuda_is_available()
   13.                 └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:686:3'): ATT give proper var ─────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:686:3
   2.   └─causalOT:::cotProblem(data, estimand, method, options)
   3.     └─causalOT:::gridSearch(data, estimand, method, options)
   4.       └─causalOT:::balanceDistributions(...)
   5.         ├─base::do.call(cotOptions, options)
   6.         └─causalOT (local) `<fn>`(NULL)
   7.           └─causalOT:::cuda_device_check(device)
   8.             └─torch::cuda_is_available()
   9.               └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:730:3'): ATT give proper var lm ──────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:730:3
   2.   └─causalOT:::cotProblem(data, estimand, method, options)
   3.     └─causalOT:::gridSearch(data, estimand, method, options)
   4.       └─causalOT:::balanceDistributions(...)
   5.         ├─base::do.call(cotOptions, options)
   6.         └─causalOT (local) `<fn>`(NULL)
   7.           └─causalOT:::cuda_device_check(device)
   8.             └─torch::cuda_is_available()
   9.               └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:775:3'): ATC give proper var ─────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:775:3
   2.   └─causalOT:::cotProblem(data, estimand, method, options)
   3.     └─causalOT:::gridSearch(data, estimand, method, options)
   4.       └─causalOT:::balanceDistributions(...)
   5.         ├─base::do.call(cotOptions, options)
   6.         └─causalOT (local) `<fn>`(NULL)
   7.           └─causalOT:::cuda_device_check(device)
   8.             └─torch::cuda_is_available()
   9.               └─torch:::cpp_cuda_is_available()
  ── Error ('test-estimate_effect.R:819:3'): ATC give proper var lm ──────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
      ▆
   1. └─causalOT::calc_weight(original, estimand = estimand, method = "NNM") at test-estimate_effect.R:819:3
   2.   └─causalOT:::cotProblem(data, estimand, method, options)
   3.     └─causalOT:::gridSearch(data, estimand, method, options)
   4.       └─causalOT:::balanceDistributions(...)
   5.         ├─base::do.call(cotOptions, options)
   6.         └─causalOT (local) `<fn>`(NULL)
   7.           └─causalOT:::cuda_device_check(device)
   8.             └─torch::cuda_is_available()
   9.               └─torch:::cpp_cuda_is_available()
  ── Error ('test-gridSearch.R:119:3'): gridSearch COT ───────────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-gridSearch.R:119:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─causalOT:::gridSearch(...)
    7.   └─causalOT:::balanceDistributions(...)
    8.     ├─base::do.call(cotOptions, options)
    9.     └─causalOT (local) `<fn>`(niter = 2L, nboot = 2, debias = TRUE, torch.optimizer = `<optm_lbf>`)
   10.       └─causalOT:::cuda_device_check(device)
   11.         └─torch::cuda_is_available()
   12.           └─torch:::cpp_cuda_is_available()
  ── Error ('test-gridSearch.R:168:3'): gridSearch NNM ───────────────────────────
  <std::runtime_error/C++Error/error/condition>
  Error in `cpp_cuda_is_available()`: Lantern is not loaded. Please use `install_torch()` to install additional dependencies.
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test-gridSearch.R:168:3
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─causalOT:::gridSearch(...)
    7.   └─causalOT:::balanceDistributions(...)
    8.     ├─base::do.call(cotOptions, options)
    9.     └─causalOT (local) `<fn>`(niter = 2L, nboot = 2, debias = TRUE, torch.optimizer = `<optm_lbf>`)
   10.       └─causalOT:::cuda_device_check(device)
   11.         └─torch::cuda_is_available()
   12.           └─torch:::cpp_cuda_is_available()
  
  [ FAIL 22 | WARN 1 | SKIP 30 | PASS 123 ]
  Error: Test failures
  Execution halted