mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 02:38:10 +00:00
Add the tensor function.
This commit is contained in:
@ -309,10 +309,16 @@ fn stack(tensors: Vec<PyTensor>, dim: usize) -> PyResult<PyTensor> {
|
||||
Ok(PyTensor(tensor))
|
||||
}
|
||||
|
||||
#[pyfunction]
|
||||
fn tensor(py: Python<'_>, vs: PyObject) -> PyResult<PyTensor> {
|
||||
PyTensor::new(py, vs)
|
||||
}
|
||||
|
||||
#[pymodule]
|
||||
fn candle(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
|
||||
m.add_class::<PyTensor>()?;
|
||||
m.add_function(wrap_pyfunction!(cat, m)?)?;
|
||||
m.add_function(wrap_pyfunction!(tensor, m)?)?;
|
||||
m.add_function(wrap_pyfunction!(stack, m)?)?;
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user