Skip to content

Math Operations Parallel

Located in Gradien.Ops.Math and Gradien.Ops.BLAS. These operations are parallelized.

Element-wise

All element-wise operations support broadcasting semantics implicitly if implemented in the kernel.

.add

lua
(A: Tensor, B: Tensor) -> Tensor

.sub

lua
(A: Tensor, B: Tensor) -> Tensor

.mul

lua
(A: Tensor, B: Tensor) -> Tensor

.scalarAdd

Adds a scalar value s to every element of A.

lua
(A: Tensor, s: number) -> Tensor

.scalarMul

Multiplies every element of A by scalar s.

lua
(A: Tensor, s: number) -> Tensor

Linear Algebra

.matmul

Performs Matrix Multiplication.

lua
(A: Tensor, B: Tensor) -> Tensor