- Finish the first 12 days for Rust practice
- Use tch in at least 5 problems
- Dockerized CI with tch support for fun
- Actually understand Rust-y implementations of cyclic data structures
The following instructions set up Torch support, albeit without GPU by default. They are geared towards Apple Silicon, though they should work OK on x86 as well.
-
Set up Cargo
-
Enable
nightly
Rust withrustup
, since the project needs features currently only on nightly, like benchmarking support. -
Set up a Python Anaconda environment and activate it.
-
Install PyTorch in this environment:
conda install pytorch::pytorch torchvision torchaudio -c pytorch
- Do not enable
LIBTORCH_USE_PYTORCH
.
- Do not enable
-
Now you can finally build and run problems:
cargo run --release --bin <XX_problem>
Special thanks to this repo for a simple example of running Torch and its Rust bindings!