mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
Detach the tensors on batch-norm eval. (#1702)
* Detach the tensors on batch-norm eval. * Fix pyo3 bindings. * Black tweak. * Formatting. * Also update the pyo3-onnx formatting. * Apply black.
This commit is contained in:
@ -938,8 +938,8 @@ impl PyTensor {
|
||||
|
||||
/// Detach the tensor from the computation graph.
|
||||
/// &RETURNS&: Tensor
|
||||
fn detach(&self) -> PyResult<Self> {
|
||||
Ok(PyTensor(self.0.detach().map_err(wrap_err)?))
|
||||
fn detach(&self) -> Self {
|
||||
PyTensor(self.0.detach())
|
||||
}
|
||||
|
||||
/// Returns a copy of the tensor.
|
||||
|
Reference in New Issue
Block a user