Fork me on GitHub

src/arraymancer/tensor/accessors_macros_write

Search:
Group by:
  Source Edit

Macros

macro `[]=`[T](t: var Tensor[T]; args: varargs[untyped]): untyped

Modifies a tensor inplace at the corresponding location or slice

Input:

  • a var tensor
  • a location or a boolean mask:
    • specific coordinates (varargs[int])
    • or a slice (cf. tutorial)
    • or a boolean tensor or openArray mask with the same shape as the tensor
  • a value:
    • a single value that will
      • replace the value at the specific coordinates
      • or be applied to the whole slice
      • or be applied to the true elements of the boolean mask
    • a tensor or openArray with a shape that matches the slice
    • a tensor whose values will be applied to the true elements of the boolean mask

Result:

  • Nothing, the tensor is modified in-place

Usage:

  Source Edit

Templates

template `[]=`[T](t: Tensor[T]; args: varargs[untyped]): untyped
  Source Edit
Arraymancer Technical reference Tutorial Spellbook (How-To's) Under the hood