Skip to content

Conversation

@firstprayer
Copy link

@firstprayer firstprayer commented Jun 20, 2020

[ghstack-poisoned]
@firstprayer firstprayer requested a review from apaszke as a code owner June 20, 2020 21:57
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 20, 2020
firstprayer pushed a commit that referenced this pull request Jun 20, 2020
ghstack-source-id: afd3a57
Pull Request resolved: #40348
@dr-ci
Copy link

dr-ci bot commented Jun 20, 2020

💊 CI failures summary and remediations

As of commit 427d53b (more details on the Dr. CI page):


  • 1/2 failures possibly* introduced in this PR
    • 1/1 non-CircleCI failure(s)
  • 1/2 broken upstream at merge base 44b018d since Jul 31

🚧 1 ongoing upstream failure:

These were probably caused by upstream breakages that are not fixed yet:


ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 13 times.


template<class T, class Iterator>
bool operator==(const ListElementReference<T, Iterator>& lhs, const T& rhs) {
T lhs_tmp = lhs;
Copy link
Collaborator

Choose a reason for hiding this comment

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

this overload looks fine to me. cc @smessmer will this custom == overload have any implications on the list impl?

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's restrict it to only work on const ListElementReference<T, Iterator>& rhs. operator== should be symmetric or the API gets weird because a == b does something different than b == a.

Copy link
Author

Choose a reason for hiding this comment

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

@smessmer just to confirm, is the suggestion to add a mirror version of this overload as well, or just not have overload at all?

If without this overload, then std::find() will not compile (see #40327 (comment))

Copy link
Author

Choose a reason for hiding this comment

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

@smessmer just to confirm, is the suggestion to add a mirror version of this overload as well, or just not have overload at all?

If without this overload, then std::find() will not compile (see #40327 (comment))

@smessmer ping :)

Copy link
Contributor

Choose a reason for hiding this comment

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

ok sg. I meant to remove the overload, but std::find convinced me. Having it symmetrical is fine.

Copy link
Collaborator

@wanchaol wanchaol 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, could you either redirect this change to the first PR, or rename this PR with title and proper description so that we can merge it? thanks!


template<class T, class Iterator>
bool operator==(const ListElementReference<T, Iterator>& lhs, const T& rhs) {
T lhs_tmp = lhs;
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's restrict it to only work on const ListElementReference<T, Iterator>& rhs. operator== should be symmetric or the API gets weird because a == b does something different than b == a.

@firstprayer firstprayer changed the title 2nd approach for #39210 Support List[str].index (#39210) Jun 26, 2020
firstprayer pushed a commit that referenced this pull request Jun 26, 2020
ghstack-source-id: 56f8ea1
Pull Request resolved: #40348
Copy link
Author

@firstprayer firstprayer left a comment

Choose a reason for hiding this comment

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

added the symmetry overload

@firstprayer firstprayer requested a review from smessmer June 26, 2020 06:07
firstprayer pushed a commit that referenced this pull request Jul 25, 2020
ghstack-source-id: cec30d1
Pull Request resolved: #40348
firstprayer pushed a commit that referenced this pull request Aug 1, 2020
ghstack-source-id: f3877e8
Pull Request resolved: #40348
Copy link
Collaborator

@wanchaol wanchaol 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, thanks!

@facebook-github-bot
Copy link
Contributor

@firstprayer merged this pull request in d403983.

@facebook-github-bot facebook-github-bot deleted the gh/firstprayer/2/head branch August 5, 2020 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[jit] ScriptModules cannot call index() on Lists.

6 participants