Function matmul

Computes the matrix multiplication between two rank-2 tensors.

Operation matmul (
  Operation lhs,
  Operation rhs,
  string mod = __MODULE__,
  ulong line = cast(ulong)__LINE__
);

Parameters

NameDescription
lhs The tensor on the left-hand side of the operation.
rhs The tensor on the right-hand side of the operation.

Returns

The resulting operation.

Example

import dopt.core : evaluate;

auto a = float32([2, 1], [
    1.0f,
    2.0f
]);

auto b = float32([1, 2], [
    3.0f, 4.0f
]);

auto c = matmul(a, b);

assert(c.evaluate().as!float == [
    3.0f, 4.0f,
    6.0f, 8.0f
]);