Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of parentheses in DaCe programs #1295

Closed
lamyiowce opened this issue Jul 4, 2023 · 1 comment · Fixed by #1498
Closed

Incorrect parsing of parentheses in DaCe programs #1295

lamyiowce opened this issue Jul 4, 2023 · 1 comment · Fixed by #1498
Labels

Comments

@lamyiowce
Copy link
Contributor

It looks like parentheses don't get parsed correctly.

import dace
import numpy as np

N, F_in, F_out =  2, 3, 4

@dace.program
def fn(a, b, c):
  c[:] = (a.T @ b).T

a = np.random.rand(N, F_in)
b = np.random.rand(N, F_out)
c_expected = np.zeros((F_out, F_in))
c = np.zeros((F_out, F_in))

fn.f(a, b, c_expected)
fn(a, b, c)
print(c)
print(c_expected)
assert np.allclose(c, c_expected)

Throws an error:

DaceSyntaxError: Use of undefined variable "(a"
@tbennun
Copy link
Collaborator

tbennun commented Jan 7, 2024

@lamyiowce Thank you for reporting this! PR #1498 fixes the issue and adds an appropriate test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants