dot

abstract infix fun StructureND<T>.dot(other: StructureND<T>): Tensor<T>(source)

Matrix product of two tensors.

The behavior depends on the dimensionality of the tensors as follows:

  1. If both tensors are 1-dimensional, the dot product (scalar) is returned.

  2. If both arguments are 2-dimensional, the matrix-matrix product is returned.

  3. If the first argument is 1-dimensional and the second argument is 2-dimensional, a 1 is prepended to its dimension for the purpose of the matrix multiply. After the matrix multiply, depending on the implementation the prepended dimension might be removed.

  4. If the first argument is 2-dimensional and the second argument is 1-dimensional, the matrix-vector product is returned.

Otherwise, throw an exception.

Return

a mathematical product of two tensors.

Parameters

other

tensor to be multiplied.