Skip to content

Commit

Permalink
Bug fix: do not try to multiply empty tensor(s).
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalgaudel committed Nov 21, 2024
1 parent abb7886 commit b6614c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/TiledArray/einsum/tiledarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ auto einsum(expressions::TsrExpr<ArrayA_> A, expressions::TsrExpr<ArrayB_> B,
using TensorT = std::remove_reference_t<decltype(el)>;

auto mult_op = [&inner](auto const &l, auto const &r) -> TensorT {
if (l.empty() || r.empty()) return TensorT{};
return inner.h ? TA::detail::tensor_hadamard(l, inner.A, r,
inner.B, inner.C)
: TA::detail::tensor_contract(l, inner.A, r,
Expand Down

0 comments on commit b6614c6

Please sign in to comment.