torch.tvarant¶
Importing torch_tvarant registers the tvarant PrivateUse1 backend and
exposes helpers under torch.tvarant (same idea as torch.cuda / torch.mps).
import torch
import torch_tvarant
assert torch.tvarant.is_available()
x = torch.empty(2, 3, device="tvarant")
Click an API below for the full signature, parameters, and examples.
Device¶
| API | Summary |
|---|---|
is_available |
Whether the backend can run |
is_initialized |
Lazy init completed |
device_count |
Number of logical devices |
current_device |
Current device index |
set_device |
Select device index |
synchronize |
Wait for kernels |
backend |
"sim" or "opencl" |
RNG¶
| API | Summary |
|---|---|
manual_seed |
Seed Tvarant RNG |
manual_seed_all |
Seed all devices |
get_rng_state |
Read RNG state |
set_rng_state |
Restore RNG state |
See also: torch_tvarant.compiler.