Skip to content

[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

Merged
merged 2 commits into from
May 24, 2021

Conversation

wyzero
Copy link
Contributor

@wyzero wyzero commented May 21, 2021

The new interface is more safe to be used during dialect conversion
(e.g. converting from tensor world to buffer world).

The new interface is more safe to be used during dialect conversion
(e.g. converting from tensor world to buffer world).
@google-ml-butler google-ml-butler bot added the size:M CL Change Size: Medium label May 21, 2021
@google-cla google-cla bot added the cla: yes label May 21, 2021
@@ -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>();
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Done.

@google-cla
Copy link

google-cla bot commented May 21, 2021

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.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added cla: no and removed cla: yes labels May 21, 2021
@google-ml-butler google-ml-butler bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels May 21, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label May 21, 2021
@gbaned gbaned self-assigned this May 21, 2021
@wyzero
Copy link
Contributor Author

wyzero commented May 24, 2021

@joker-eph @gbaned import/copybara — An error happened while migrating the change. Is there any detail about this? What can I do for this?

@gbaned gbaned added ready to pull PR ready for merge process and removed ready to pull PR ready for merge process labels May 24, 2021
copybara-service bot pushed a commit to tensorflow/mlir-hlo that referenced this pull request May 24, 2021
…` 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
@copybara-service copybara-service bot merged commit 9466dcd into tensorflow:master May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes ready to pull PR ready for merge process size:M CL Change Size: Medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants