Fork me on GitHub

src/arraymancer/tensor/shapeshifting_opencl

Search:
Group by:
  Source Edit

Procs

proc broadcast2[T](a, b: ClTensor[T]): tuple[a, b: ClTensor[T]] {.noSideEffect,
    noinit.}

Broadcast 2 tensors so they have compatible shapes for element-wise computations.

Tensors in the tuple can be accessed with output.a and output.b

The returned broadcasted Tensors share the underlying data with the input.

Dimension(s) of size 1 can be expanded to arbitrary size by replicating values along that dimension.

Warning âš : This is a no-copy operation, data is shared with the input. This proc does not guarantee that a let value is immutable. A broadcasted tensor should not be modified and only used for computation.

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