use pyo3::prelude::*;
pub mod device;
pub mod dtype;
pub mod error;
pub mod nn;
pub mod optim;
pub mod tensor;
pub mod utils;
pub mod autograd;
pub mod data;
pub mod distributed;
pub use device::PyDevice;
pub use dtype::PyDType;
pub use error::TorshPyError;
pub use tensor::PyTensor;
#[pymodule]
fn rstorch(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<PyTensor>()?;
m.add_class::<PyDevice>()?;
m.add_class::<PyDType>()?;
nn::register_nn_module(m.py(), m)?;
optim::register_optim_module(m.py(), m)?;
let data_module = PyModule::new(m.py(), "data")?;
data::register_data_module(m.py(), &data_module)?;
m.add_submodule(&data_module)?;
let autograd_module = PyModule::new(m.py(), "autograd")?;
autograd::register_autograd_module(m.py(), &autograd_module)?;
m.add_submodule(&autograd_module)?;
let distributed_module = PyModule::new(m.py(), "distributed")?;
distributed::register_distributed_module(m.py(), &distributed_module)?;
m.add_submodule(&distributed_module)?;
tensor::register_creation_functions(m)?;
device::register_device_constants(m)?;
dtype::register_dtype_constants(m)?;
error::register_error_types(m)?;
m.add("__version__", env!("CARGO_PKG_VERSION"))?;
Ok(())
}
#[pymodule]
fn rstorch_python(m: &Bound<'_, PyModule>) -> PyResult<()> {
rstorch(m)
}