From b6614c61a6680bb7de319c7aab506b704fc30aeb Mon Sep 17 00:00:00 2001 From: Bimal Gaudel Date: Thu, 21 Nov 2024 08:42:31 -0500 Subject: [PATCH] Bug fix: do not try to multiply empty tensor(s). --- src/TiledArray/einsum/tiledarray.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TiledArray/einsum/tiledarray.h b/src/TiledArray/einsum/tiledarray.h index e341e646a9..ace7caa15a 100644 --- a/src/TiledArray/einsum/tiledarray.h +++ b/src/TiledArray/einsum/tiledarray.h @@ -664,6 +664,7 @@ auto einsum(expressions::TsrExpr A, expressions::TsrExpr B, using TensorT = std::remove_reference_t; 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,