Closed janeyx99 closed 2 years ago
Welp, lol, messing with the parameters did not go well--I'll take another look tomorrow but let me know if you have any advice--I kept getting errors when I didn't use *operands about shapes getting multiple inputs :c.
Welp, lol, messing with the parameters did not go well--I'll take another look tomorrow but let me know if you have any advice--I kept getting errors when I didn't use *operands about shapes getting multiple inputs :c.
That is very odd- can you post the exact error message?
That is very odd- can you post the exact error message?
We are good now!
Is there anything on my end I should do to merge this PR?
I'll recap from a comment above:
We have a faulty test in this case, It just so happens that len(arr) provides the shape of the first dimension. We need to ensure that a corresponding test fails for the given test case. A fairly minor point, but the tests as written can be misleading in the future.
I think we need to make sure the test properly raises if an array is passed as a shape. Either that or detect automatically if the object has a .shape
attribute or not.
Ah oops, I didn't see that last comment. I've added a test case now.
Lint failure looks unrelated
Looks like MyPy bumped, would you mind fixing? Removing the "type: ignore"
from line opt_einsum/paths.py:1251
should patch it.
Amazing, thank you!
Description
This PR adds support for the shapes kwarg for
parse_einsum_input
. This also fixes a bug wherecontract_path
takes in the shapes parameter butparse_einsum_input
is called without respecting the shapes parameter.The bug results because even though the user had input shapes as True,
contract_path
will callparse_einsum_input
before caring about shapes, and withinparse_einsum_input
, will call .shape on an array that is already a shape.Todos
Notable points that this PR has either accomplished or will accomplish.
Questions
Status