tests/testthat/test-backends.R

test_that("cudnn_available", {
  skip_if(!cuda_is_available())

  expect_true(backends_cudnn_is_available())
  expect_s3_class(backends_cudnn_version(), "numeric_version")
})

test_that("mps is available on M1 macs", {
  skip_if_not_m1_mac()
  expect_true(backends_mps_is_available())
})

Try the torch package in your browser

Any scripts or data that you put into this service are public.

torch documentation built on May 29, 2024, 9:54 a.m.