Class RealCsrMatrixTensorDot

java.lang.Object
org.flag4j.linalg.ops.sparse.csr.real.RealCsrMatrixTensorDot

public final class RealCsrMatrixTensorDot extends Object
This utility class provides implementations for tensor dot products on two real sparse CSR matrices.
  • Method Details

    • tensorDot

      public static Matrix tensorDot(CsrMatrix src1, CsrMatrix src2, int[] src1Axes, int[] src2Axes)
      Computes the tensor contraction of src1 with src2 over the specified set of axes. That is, computes the sum of products between the two tensors along the specified set of axes.
      Parameters:
      src1 - First tensor in the contraction.
      src2 - Second tensor in the contraction.
      src1Axes - Axes along which to compute products for src1 tensor.
      src2Axes - Axes along which to compute products for src2 tensor.
      Returns:
      The tensor dot product over the specified axes. If the result is a rank zero tensor a 1-by-1 matrix with the value will be returned. If the result is a rank one tensor a matrix with a single row will be returned.
      Throws:
      IllegalArgumentException - If the two tensors shapes do not match along the specified axes pairwise in aAxes and bAxes.
      IllegalArgumentException - If aAxes and bAxes do not match in length, or if any of the axes are out of bounds for the corresponding tensor.