Fork me on GitHub
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood

Module exporting

Group by:


proc toRawSeq[T](t: Tensor[T]): seq[T] {.
Convert a tensor to the raw sequence of data.   Source Edit
proc export_tensor[T](t: Tensor[T]): tuple[shape: seq[int], strides: seq[int],
                                        data: seq[T]] {.
Export the tensor as a tuple containing
  • shape
  • strides
  • data

If the tensor was not contiguous (a slice for example), it is reshaped. Data is exported in C order (last index changes the fastest, column in 2D case)

  Source Edit