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

Operations fusion

Templates

template rewriteTensor_MultiplyAdd{*(A, B) + C
}[T](A, B, C: Tensor[T]): auto

Fuse A*B + C into a single operation.

Operation fusion leverage the Nim compiler and should not be called explicitly.

  Source Edit
template rewriteTensor_MultiplyAdd{C + *(A, B)
}[T](A, B, C: Tensor[T]): auto

Fuse C + A * B into a single operation.

Operation fusion leverage the Nim compiler and should not be called explicitly.

  Source Edit
template rewriteTensor_MultiplyAdd_inplace{C += *(A, B)
}[T](A, B: Tensor[T]; C: var Tensor[T])

Fuse C+=A*B into a single operation.

Operation fusion leverage the Nim compiler and should not be called explicitly.

  Source Edit
template rewriteToTensorReshape{reshape(toTensor(oa, dummy_bugfix), shape)
}(oa: openArray; shape: varargs[int]; dummy_bugfix: static[int]): auto

Fuse sequence.toTensor.reshape(new_shape) into a single operation.

Operation fusion leverage the Nim compiler and should not be called explicitly.

  Source Edit