Fork me on GitHub

src/arraymancer/tensor/init_cuda

  Source Edit

Procs

proc cpu[T: SomeFloat](t: CudaTensor[T]): Tensor[T] {.noSideEffect, noinit.}
Convert a tensor on a Cuda device to a tensor on Cpu.   Source Edit
proc cuda[T: SomeFloat](t: Tensor[T]): CudaTensor[T] {.noinit.}
Convert a tensor on Cpu to a tensor on a Cuda device.   Source Edit
proc ones_like[T: SomeFloat](t: CudaTensor[T]): CudaTensor[T] {.noinit, inline.}
Creates a new CudaTensor filled with 1 with the same shape as the input and filled with 1 Input:
- A CudaTensor

Result:

- A one-ed CudaTensor of the same shape
  Source Edit
proc zeros_like[T: SomeFloat](t: CudaTensor[T]): CudaTensor[T] {.noinit, inline.}
Creates a new CudaTensor filled with 0 with the same shape as the input Input:
- Shape of the CudaTensor
- Type of its elements

Result:

- A zero-ed CudaTensor of the same shape
  Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood