tests/testthat/test-scalar.R

context("scalar")

test_that("double scalar", {
  expect_true(is_torch_scalar(torch_scalar(1)))
})

test_that("int scalar", {
  expect_true(is_torch_scalar(torch_scalar(1L)))
})

test_that("bool scalar", {
  expect_true(is_torch_scalar(torch_scalar(TRUE)))
})

Try the torch package in your browser

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

torch documentation built on June 7, 2023, 6:19 p.m.