Skip to content

Commit

Permalink
tensor.nelements -> tensor.nelement
Browse files Browse the repository at this point in the history
  • Loading branch information
LLukas22 committed Oct 29, 2023
1 parent 4348569 commit 8671814
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion candle-pyo3/py_src/candle/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ class Tensor:
"""
pass
@property
def nelements(self) -> int:
def nelement(self) -> int:
"""
Gets the tensor's element count.
"""
Expand Down
2 changes: 1 addition & 1 deletion candle-pyo3/py_src/candle/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion candle-pyo3/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 8671814

Please sign in to comment.