Fork me on GitHub

src/arraymancer/io/io_npy

Search:
Group by:
  Source Edit

Procs

proc read_npy[T: SomeNumber](npyPath: string): Tensor[T] {.noinit.}

Reads a .npy file and returns a Tensor of the specified type. If the ndarray is stored in a different type inside the file, it will be converted.

Input:

  • The path to a numpy file as string

Output:

  • A tensor

Only integer, unsigned integer and float ndarrays are supported at the moment.

  Source Edit
proc write_npy[T: SomeNumber](t: Tensor[T]; npyPath: string)

Export a Tensor to the Numpy format

Input:

  • The tensor
  • The path to a numpy file as string

Only integer, unsigned integer and float ndarrays are supported at the moment.

  Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood