Skip to content

Conversation

polvalente
Copy link
Contributor

Allows calling Elixir functions inside defn expressions.

Currently limited to Nx.Defn.Evaluator. EXLA will be able to support this in a future PR by making use of Nx.Defn.Graph, splitting the expression before and after the elixir_call node, creating an isolated stage for the elixir call.

@josevalim
Copy link
Collaborator

Great! Although I'm not sure if it elixir_call is the best name? It also seems this relates to optional callbacks somehow? For example, optional callbacks require a default implementation in Elixir to be given, so they have similar dispatch mechanisms. On the other hand, we may also want to allow what is defined as an Elixir call to go through grad or be optimised in EXLA. So I'm thinking there is an overall unified mechanism where they are specified the same, but the compiler decides if it is a split or compiled, based on its structure at compile time. Glad to chat about it later!

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.

2 participants