-
Notifications
You must be signed in to change notification settings - Fork 351
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
feat: support aten._local_scalar_dense converter #2752
base: main
Are you sure you want to change the base?
Conversation
I would appreciate your feedback on the type-related issues mentioned in the description. |
@chohk88 @narendasan I checked the aten schema where there are only two funcs return
I found some people have similar issues like: pytorch/xla#909 For the functionality, my understanding to this function is to extract the first element in the input, whatever it is a single tensor or list of tensors, and then move it to CPUs. If true, I don't think it's meaningful to implement this converter. Instead, we can have a lowering pass to remove this op to avoid potential graph breaks. Do you know why this converter is needed? or is this op used in any models? |
Needs #2810 to be implemented to fully work |
8a80daf
to
aa18d8f
Compare
aa18d8f
to
8831462
Compare
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.
This looks good to me. Seems like all this op does is to gather the first element.
To reviewer, I did not incorporate type-specific considerations in the implementation of the converter and test code.
The type should always be the input data type correct ?
Description
A converter for the torch.ops.aten._local_scalar_dense operation, a low-level operation in PyTorch used internally to extract a scalar value from a tensor containing a single element.
To reviewer, I did not incorporate type-specific considerations in the implementation of the converter and test code. However, all test cases have successfully passed. I would greatly appreciate any feedback or suggestions regarding this aspect—especially if there are potential implications or improvements I might have overlooked.
Fixes # (issue)
Type of change
Please delete options that are not relevant and/or add your own.
Checklist: