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

[lang] "ti.chain_compare" now can return python-scope constants #1356

Merged

Conversation

archibate
Copy link
Collaborator

This reverts commit d1a356e.

Related issue = to make a way for #1344

[Click here for the format server]


Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this will reopen #327?

Copy link
Contributor

@xumingkuan xumingkuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good -- I just checked that 1 < ti.append(x.snode().parent(), [], 1) < 10 won't be evaluated twice.

@archibate archibate added the LGTM label Jun 30, 2020
@yuanming-hu
Copy link
Member

What if the user calls a ti.func with side-effects in a chain comparison?

@archibate
Copy link
Collaborator Author

What if the user calls a ti.func with side-effects in a chain comparison?

Do we have a test on this? If not, let me write one.

@archibate

This comment has been minimized.

@yuanming-hu
Copy link
Member

What if the user calls a ti.func with side-effects in a chain comparison?

Do we have a test on this? If not, let me write one.

We don't have one now. Please write one, likely near test_no_duplicate_eval. Thank you!

b = ti.var(ti.i32, ())

@ti.func
def why_this_foo_fail(n):
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix in #1380.


@ti.kernel
def func():
a[None] = 0 <= foo(2) < 1
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done here @yuanming-hu.

@archibate
Copy link
Collaborator Author

Merging this to make a way for #1344, and better #1380 test.

@archibate archibate merged commit 28e005c into taichi-dev:master Jul 3, 2020
@FantasyVR FantasyVR mentioned this pull request Jul 4, 2020
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

Successfully merging this pull request may close these issues.

4 participants