Skip to content
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

Reject promises for in-progress operations on an MLTensor if it is destroyed #799

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

a-sully
Copy link
Contributor

@a-sully a-sully commented Dec 13, 2024

This PR handles the following case:

const promise = context.readTensor(tensor);
// Destroy `tensor` before awaiting `promise`
tensor.destroy();  // This should reject

The current spec does not reject promise in this example. This PR updates the spec to match the Chromium implementation and what I assume to be the desired behavior (please speak up otherwise!)

Note that Chromium implements a similar pattern in other cases where the MLContext may be destroyed (either intentionally or unexpectedly), but specification of that work should follow #744


Preview | Diff

Copy link
Member

@inexorabletash inexorabletash left a comment

Choose a reason for hiding this comment

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

LGTM with one nitpick

index.bs Outdated Show resolved Hide resolved
Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants