View Source Npy
Npy handles npy/npz file - loading or saving array and so on. You can use Npy to exchange array data with Python.
- load %Npy/%Nx.Tensor from npy file.
- load a list of %Npy/%Nx.Tensor from npz - zipped npy - file.
- save %Npy/%Nx.Tensor to npy file.
- save a list of %Npy/%Nx.Tensor to npz file.
- convert %Npy to/from %Nx.Tensor.
- save %Npy to CSV file.
installation
Installation
Npy is pure Elixir module. You need to add following code as a dependency to your mix.exs
:
def deps do
[
{:npy, "~> 0.1.1"}
]
end
I cannot publish this module to Hex, because depending module - Nx - isn't Hex item yet.
hello-world
Hello World
iex> t = t = Nx.random_uniform({5,5})
iex> Npy.save("random.npy", t)
iex> {:ok, s} = Npy.load("random.npy")
c-companion
C++ companion
There are C++ codes to handle npy file under "cxx_companion" directory. You can use it in your C++ application to handle npy free.
license
License
Npy is licensed under the Apache License Version 2.0.