From 6f902a773e5e161e797e9bdf6a019a019ab2681f Mon Sep 17 00:00:00 2001 From: Johnnie Gray Date: Fri, 13 Oct 2023 14:18:20 -0700 Subject: [PATCH] fix for exprs with constants --- cotengra/interface.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cotengra/interface.py b/cotengra/interface.py index 45a288f..edb540c 100644 --- a/cotengra/interface.py +++ b/cotengra/interface.py @@ -661,6 +661,10 @@ def array_contract_expression( -------- einsum_expression, array_contract, array_contract_tree """ + inputs, output, size_dict = normalize_input( + inputs, output, size_dict, shapes, canonicalize=canonicalize + ) + if constants is not None: # handle constants specially with autoray return _array_contract_expression_with_constants( @@ -673,10 +677,6 @@ def array_contract_expression( **kwargs, ) - inputs, output, size_dict = normalize_input( - inputs, output, size_dict, shapes, canonicalize=canonicalize - ) - if cache and can_hash_optimize(optimize.__class__): try: key = hash_contraction(