Nx integration helpers for Dala on iOS.
Nx itself is pure Elixir and works on any platform. This module provides iOS-specific helpers and backend selection logic.
Summary
Functions
Returns the default backend for the current iOS platform.
Checks if EMLX is available.
Example: Simple neural network layer using Axon on iOS.
Runs inference with a model using the best available backend.
Initializes Nx with the best available backend for iOS.
Loads a pre-trained model for inference on iOS.
Creates a tensor on iOS with platform-appropriate backend.
Functions
Returns the default backend for the current iOS platform.
Checks if EMLX is available.
Example: Simple neural network layer using Axon on iOS.
Note: Axon is pure Elixir and works on any platform with Nx. This is just an example - Axon needs to be added as a dependency.
Runs inference with a model using the best available backend.
Initializes Nx with the best available backend for iOS.
Priority:
- EMLX (if available) - best for Apple Silicon
- Nx default (pure Elixir fallback)
Loads a pre-trained model for inference on iOS.
Note: This is a placeholder. In practice, you would:
- Train or download a pre-trained model
- Serialize it (Axon supports serialization)
- Load it here for inference
Creates a tensor on iOS with platform-appropriate backend.