-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[jit] add for in string support #21990
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
Conversation
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
| Value* cur_elem = nullptr; | ||
| if (val_type->cast<ListType>()) { | ||
| cur_elem = g.insert(aten::select, {val, i}, {}, loc); | ||
| } else if (val_type->cast<StringType>()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to standardize a builtin like "getelem" to be used here rather than have a big if branch that emits different code, similar to our other magic methods. Furthermore, we should make serialization emit this as foo[i] so that we do not end up getting committed to preserving these operator names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this, will make a separate PR to define it. We will need to follow up on design the deprecation strategy of those prim operators that should be deleted.
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
[jit] add for in string support gh-metadata: pytorch pytorch 21990 gh/wanchaol/24/head
Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use
Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
[jit] register __getitem__ builtin Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
[jit] register __getitem__ builtin Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
[jit] register __getitem__ builtin Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
[jit] register __getitem__ builtin Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
[jit] register __getitem__ builtin Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
[jit] register __getitem__ builtin Summary: Follow up of #21990, I am switching index select operations to a standard __getitem__ builtin, rather than bunch of different builtins according to the type, such as prim::DictIndex, prim::ListIndex, etc. This will also aligned with the some other magic methods that we already use gh-metadata: pytorch pytorch 22276 gh/wanchaol/28/head
Stack from ghstack:
Differential Revision: D15948547