Packages

Production ML model serving on the BEAM. Serve PyTorch models faster than Python with pre-compiled graph execution, AOTI compiled inference, and OTP fault tolerance.

Current section

Files

Jump to
extorch lib extorch native native.ex
Raw

lib/extorch/native/native.ex

defmodule ExTorch.Native do
@moduledoc """
The `ExTorch.Native` module contains all NIF declarations to call libtorch in C++.
All the declarations contained here are placeholder to native calls generated with `Rustler` and
implemented via Rust.
Argument optional function declarations with default values are provided on the `ExTorch` module.
"""
use ExTorch.Native.Tensor.Creation
use ExTorch.Native.Tensor.Info
use ExTorch.Native.Tensor.Ops.Indexing
use ExTorch.Native.Tensor.Ops.Manipulation
use ExTorch.Utils.DownloadTorch
use Rustler, otp_app: :extorch, crate: "extorch", env: [{"CARGO_TERM_VERBOSE", "true"}]
# When your NIF is loaded, it will override this function.
def add(_a, _b), do: :erlang.nif_error(:nif_not_loaded)
end