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

Can SparseTIR support operations other than multiplication and addition? #101

Open
gxiaotian opened this issue Jul 10, 2024 · 1 comment

Comments

@gxiaotian
Copy link

Hello,

I am new to SparseTIR and wonder whether it can support operations other than multiplication and addition.

For example, the below expression is valid SparseTIR or not?

with T.sp_iter([I, J], "SR") as [i, j]:
       with T.init():
              Y[i, j] = 0.0
        Y[i] = Y[i, j] + (X[i] - X[j]) ** 2

Thanks!

@yzh119
Copy link
Member

yzh119 commented Aug 24, 2024

Sorry for the very late reply, I just noticed this issue.

Yes of course, but I'm not sure if the parser can parse ** correctly. A safer way would be
T.power(X[i] - X[j], 2)

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

No branches or pull requests

2 participants