-
Notifications
You must be signed in to change notification settings - Fork 74.7k
[MLIR][DISC] Upgrade to use the new reifyReturnTypeShapes
interface.
#49454
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
The new interface is more safe to be used during dialect conversion (e.g. converting from tensor world to buffer world).
@@ -106,9 +108,19 @@ LogicalResult ConvertResults(Operation* op, SmallVectorImpl<Value>& results, | |||
auto shape_type_op = dyn_cast<InferShapedTypeOpInterface>(op); | |||
if (!shape_type_op) return failure(); | |||
|
|||
if (tensor_operands.empty()) { | |||
for (auto operand : ArrayRef<Value>(results).take_front(num_operands)) { | |||
auto tp = operand.getType().dyn_cast<ShapedType>(); |
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.
Don't use dyn_cast
when you don't check for null, just use cast
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.
Thanks! Done.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@joker-eph @gbaned |
…` interface. Imported from GitHub PR tensorflow/tensorflow#49454 The new interface is more safe to be used during dialect conversion (e.g. converting from tensor world to buffer world). Copybara import of the project: -- a6968072d59bec3c3bbaef0121d297e807c37c91 by Wenyi Zhao <reyizero@gmail.com>: [MLIR][DISC] Upgrade to use the new `reifyReturnTypeShapes` interface. The new interface is more safe to be used during dialect conversion (e.g. converting from tensor world to buffer world). -- 55e7c6b7f2f99b99e226645a57e2433fae3e90ed by Wenyi Zhao <reyizero@gmail.com>: minor fix PiperOrigin-RevId: 375500273
The new interface is more safe to be used during dialect conversion
(e.g. converting from tensor world to buffer world).