diff --git a/src/TiledArray/tensor/kernels.h b/src/TiledArray/tensor/kernels.h index a2530f2f5d..0b0767ed81 100644 --- a/src/TiledArray/tensor/kernels.h +++ b/src/TiledArray/tensor/kernels.h @@ -417,14 +417,15 @@ inline void inplace_tensor_op(Op&& op, TR& result, const Ts&... tensors) { TA_ASSERT(!empty(result, tensors...)); TA_ASSERT(is_range_set_congruent(result, tensors...)); - const auto volume = result.range().volume(); - - for (decltype(result.range().volume()) ord = 0ul; ord < volume; ++ord) { + auto volume = result.total_size(); + for (decltype(volume) ord = 0; ord < volume; ++ord) { + if constexpr (is_tensor_of_tensor_v