Closed Geositta2000 closed 2 years ago
Hi @Geositta2000, scalars have no dimensions, so the correct way to specify their shape is an empty tuple like:
shape = ()
len(shape)
# 0
N.B. (1)
actually expands to just the integer 1
, whereas (1,)
would be the shape of vector of length 1.
Thank you!
path_info = oe.contract_expression(', pi,qj,ijkl,rk,sl->pqrs', (), (dim, dim), (dim, dim), (dim, dim, dim, dim), (dim, dim), (dim, dim))
works!
Hi,
I am thinking about including a scalar constant into the opt_einsum contraction, which may utilize the alpha/beta coefficient in DGEMM as in https://stackoverflow.com/questions/72356384/how-to-utilize-scalar-multiplication-in-einsum
The following code works
Then I think about reuse path, similar to https://optimized-einsum.readthedocs.io/en/stable/reusing_paths.html
I got
if len(sh) != len(term): TypeError: object of type 'int' has no len()
How to solve this issue? Which dimension should I use for the constant scalar part?