Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaleev/fixup/tensor empty #377

Merged
merged 2 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/TiledArray/tensor/tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ class Tensor {

/// \return \c true if this tensor was default constructed (contains no
/// data), otherwise \c false.
bool empty() const { return !this->data_; }
bool empty() const { return this->data_.use_count() == 0; }

/// MADNESS serialization function

Expand Down
4 changes: 2 additions & 2 deletions src/TiledArray/tensor/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ inline typename T::size_type inner_size(const T& tensor) {
/// This function is used as the termination step for the recursive empty()
/// function. It also handles the case where there are no tensors in the
/// list.
/// \return \c true
inline constexpr bool empty() { return true; }
/// \return \c false
inline constexpr bool empty() { return false; }

/// Test for empty tensors

Expand Down