powered by
See the TorchScript language reference for documentation on how to write TorchScript code.
jit_compile(source)
valid TorchScript source code.
if (torch_is_installed()) { comp <- jit_compile(" def fn (x): return torch.abs(x) def foo (x): return torch.sum(x) ") comp$fn(torch_tensor(-1)) comp$foo(torch_randn(10)) }
Run the code above in your browser using DataLab