From 86718144e352aab493a0196f464a567a9268f54e Mon Sep 17 00:00:00 2001 From: Lukas Kreussel <65088241+LLukas22@users.noreply.github.com> Date: Sun, 29 Oct 2023 13:55:13 +0100 Subject: [PATCH] `tensor.nelements` -> `tensor.nelement` --- candle-pyo3/py_src/candle/__init__.pyi | 2 +- candle-pyo3/py_src/candle/testing/__init__.py | 2 +- candle-pyo3/src/lib.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/candle-pyo3/py_src/candle/__init__.pyi b/candle-pyo3/py_src/candle/__init__.pyi index db07dfb315..48b1786c08 100644 --- a/candle-pyo3/py_src/candle/__init__.pyi +++ b/candle-pyo3/py_src/candle/__init__.pyi @@ -344,7 +344,7 @@ class Tensor: """ pass @property - def nelements(self) -> int: + def nelement(self) -> int: """ Gets the tensor's element count. """ diff --git a/candle-pyo3/py_src/candle/testing/__init__.py b/candle-pyo3/py_src/candle/testing/__init__.py index 7b2dec9ec3..240b635f28 100644 --- a/candle-pyo3/py_src/candle/testing/__init__.py +++ b/candle-pyo3/py_src/candle/testing/__init__.py @@ -67,4 +67,4 @@ def assert_almost_equal( threshold = (expected.abs().to_dtype(candle.f32) * rtol + atol).to(expected) - assert (diff <= threshold).sum_all().values() == actual.nelements, f"Difference between tensors was to great" + assert (diff <= threshold).sum_all().values() == actual.nelement, f"Difference between tensors was to great" diff --git a/candle-pyo3/src/lib.rs b/candle-pyo3/src/lib.rs index d1045b5bca..614a2c0ff7 100644 --- a/candle-pyo3/src/lib.rs +++ b/candle-pyo3/src/lib.rs @@ -337,7 +337,7 @@ impl PyTensor { #[getter] /// Gets the tensor's element count. /// &RETURNS&: int - fn nelements(&self) -> usize { + fn nelement(&self) -> usize { self.0.elem_count() }