matmul

Computes the matrix multiplication between two rank-2 tensors.

matmul
(,,
string mod = __MODULE__
,
size_t line = __LINE__
)

Parameters

lhs Operation

The tensor on the left-hand side of the operation.

rhs Operation

The tensor on the right-hand side of the operation.

Return Value

Type: Operation

The resulting operation.

Examples

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().get!float == [
    3.0f, 4.0f,
    6.0f, 8.0f
]);

Meta