jit_ops | R Documentation |
Call JIT operators directly from R, keeping the familiar argument types and argument order. Note, however, that:
all arguments are required (no defaults)
axis numbering (as well as position numbers overall) starts from 0
scalars have to be wrapped in jit_scalar()
jit_ops
An object of class torch_ops
of length 0.
if (torch_is_installed()) {
t1 <- torch::torch_rand(4, 5)
t2 <- torch::torch_ones(5, 4)
# same as torch::torch_matmul(t1, t2)
jit_ops$aten$matmul(t1, t2)
# same as torch_split(torch::torch_arange(0, 3), 2, 1)
jit_ops$aten$split(torch::torch_arange(0, 3), torch::jit_scalar(2L), torch::jit_scalar(0L))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.