Nothing
test_that("basic inference execution", {
library(churon)
# Check if ONNX Runtime is available
if (!check_onnx_runtime_available()) {
skip(
"ONNX Runtime not installed - run install_onnx_runtime(destdir = tempdir())"
)
}
expect_true(TRUE)
})
test_that("inference with invalid input data", {
library(churon)
# Check if ONNX Runtime is available
if (!check_onnx_runtime_available()) {
skip(
"ONNX Runtime not installed - run install_onnx_runtime(destdir = tempdir())"
)
}
model_dir <- system.file("model", package = "churon")
model_files <- list.files(model_dir, pattern = "\\.onnx$", full.names = TRUE)
if (length(model_files) > 0) {
model_path <- model_files[1]
session <- onnx_session(model_path)
# Test with empty input
expect_error(
onnx_run(session, list()),
"inputs cannot be empty"
)
# Test with unnamed input
expect_error(
onnx_run(session, list(matrix(1:4, 2, 2))),
"All inputs must be named"
)
# Test with wrong input names
expect_error(
onnx_run(session, list(wrong_name = matrix(1:4, 2, 2))),
"Missing required input tensor"
)
} else {
skip("No ONNX model files found for testing")
}
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.