Skip to content

Commit

Permalink
Merge branch 'main' into torch-2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentMazare authored Apr 24, 2024
2 parents dd74e82 + 3e86831 commit 269ff36
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/python-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name = "tch_ext"
crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.18.3", features = ["extension-module"] }
pyo3 = { version = "0.21", features = ["extension-module"] }
pyo3-tch = { path = "../../pyo3-tch", version = "0.16.0" }
tch = { path = "../..", features = ["python-extension"], version = "0.16.0" }
torch-sys = { path = "../../torch-sys", features = ["python-extension"], version = "0.16.0" }
torch-sys = { path = "../../torch-sys", features = ["python-extension"], version = "0.16.0" }
4 changes: 2 additions & 2 deletions examples/python-extension/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ fn add_one(tensor: PyTensor) -> PyResult<PyTensor> {
/// A Python module implemented in Rust using tch to manipulate PyTorch
/// objects.
#[pymodule]
fn tch_ext(py: Python<'_>, m: &PyModule) -> PyResult<()> {
py.import("torch")?;
fn tch_ext(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
py.import_bound("torch")?;
m.add_function(wrap_pyfunction!(add_one, m)?)?;
Ok(())
}
2 changes: 1 addition & 1 deletion pyo3-tch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ license = "MIT/Apache-2.0"
[dependencies]
tch = { path = "..", features = ["python-extension"], version = "0.16.0" }
torch-sys = { path = "../torch-sys", features = ["python-extension"], version = "0.16.0" }
pyo3 = { version = "0.18.3", features = ["extension-module"] }
pyo3 = { version = "0.21", features = ["extension-module"] }
5 changes: 1 addition & 4 deletions pyo3-tch/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
use pyo3::exceptions::{PyTypeError, PyValueError};
use pyo3::prelude::*;
use pyo3::{
exceptions::{PyTypeError, PyValueError},
AsPyPointer,
};
pub use tch;
pub use torch_sys;

Expand Down

0 comments on commit 269ff36

Please sign in to comment.