Skip to content

Commit

Permalink
handle scalars in compressed_contract
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Lykov committed Dec 13, 2024
1 parent bb6949f commit 126ec95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qtensor/compression/compressed_contraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ def compressed_contract(A:Tensor, B: Tensor,


need_compressed = result_indices[:-mem_limit]
new_tensor_name = 'C'+str(int(all_indices[-1]))
if len(all_indices) == 0:
new_tensor_name = 'C_s'
print(f"[Warn]: Scalar inputs in compressed contract, {A}*{B}")
else:
new_tensor_name = 'C'+str(int(all_indices[-1]))

# -- Early return: if no need to compress, do the regular contraction
if len(need_compressed)==0 and len(exist_compressed)==0:
Expand Down

0 comments on commit 126ec95

Please sign in to comment.