tch-rs icon indicating copy to clipboard operation
tch-rs copied to clipboard

Rust bindings for the C++ api of PyTorch.

Results 213 tch-rs issues
Sort by recently updated
recently updated
newest added

https://docs.rs/tch/0.7.2/tch/enum.Device.html#method.is_cuda https://github.com/pytorch/pytorch/pull/77767/files https://github.com/pytorch/pytorch/blob/master/docs/source/notes/mps.rst

Is it possible to support TorchAudio similarly to how TorchVision is included in this library? Thank you!

how to re-produce 1. clone tch-rs (version 0.7.2) 2. cd tch-rs 3. mkdir data 4. copy mnist files(gz and unzipped) into 'data' folder 5. cargo run --example mnist program exit...

I use tch-rs "0.7.2" with `libtorch-win-shared-with-deps-1.11.0+cu113` on win10. Sometimes, within the output of this layer: ```rust let shared_feature_layer = nn::seq() .add(nn::linear( p / "actor_feature", input_len, 128, Default::default(), )) .add_fn(|xs| xs.relu());...

On Win10 with cuda 11.3, and tch-rs 0.7.2 and [torchlib 1.11.0_cuda11.3](https://pytorch.org/get-started/locally/) of release version, when calling ` tch::Device::cuda_if_available(),` in release mode, it turns to using cpu. If it is forced...

For methods returning an IValue, we generally know what it contains, but it's awkward to consume by matching enum variants. Simple case: ```rust // current let result: IValue = object.method_is(...)?;...

These changes add a few additional bindings to torch_python library. Mainly: `THPVariable_Unpack` for unpacking PyObject into a Tensor pointer `THPVariable_Check` for checking whether PyObject is a valid Tensor object `THPVariable_Wrap`...

There are parameter `alpha_log_d` and related optimizer `alpha_d_opt`: ```rust let alpha_log_d = alpha_vs_d.root().var( "log_alpha_d", &[1], nn::Init::Const(-action_dim_len.ln() * f64::exp(1f64)), ); let mut alpha_d_opt = nn::Adam::default() .build(&alpha_vs_d, opt_learning_rate) .expect("init nn::Adam failed for...

I would like to be able to debug a crate using tch-rs in pycharm or clion, but I'm hitting: "error while loading shared libraries: libtorch_cpu.so" More details at: https://youtrack.jetbrains.com/issue/CPP-26265 I'm...

Sorry for dumb Rust newbie question. I understand the model can be executed using multiple threads by setting `tch::set_num_threads`. But what I'm trying to ask is can the model be...