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

Allow creating fallible closure #35

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

Conversation

minghuaw
Copy link

@minghuaw minghuaw commented Sep 25, 2024

This is an experimental attempt at solving #34. There are two major changes

  1. Introduce a new type mlx_vector_array_result (and corresponding constructor, getter functions) to indicate status of closure execution
  2. Introduce a new function mlx_fallible_closure_new_with_payload() which takes a fallible closure that returns a mlx_vector_array_result, and the inner lambda throws an exception if the closure returns an error

This is by no means a complete solution, but rather to start a discussion about this.

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.

1 participant