### Question:
MatrixMultiplyWithTransposedSecondOperand extends AbstractVariable<Matrix> { private Matrix multiply(Tensor<?> t1, Tensor<?> t2) { DMatrixRMaj m1 = DMatrixRMaj.wrap(t1.dimension(ROWS_INDEX), t1.dimension(COLUMNS_INDEX), t1.data()); DMatrixRMaj m2 = DMatrixRMaj.wrap(t2.dimension(ROWS_INDEX), t2.dimension(COLUMNS_INDEX), t2.data()); DMatrixRMaj prod = new DMatrixRMaj(m1.numRows, m2.numCols); MatrixMatrixMult_DDRM.mult_reorder(m1, m2, prod); return new Matrix(prod.getData(), prod.numRows, prod.numCols); } MatrixMultiplyWithTransposedSecondOperand(Variable<Matrix> A, Variable<Matrix> B); @Override Matrix apply(ComputationContext ctx); @Override Matrix gradient(Variable<?> parent, ComputationContext ctx); static MatrixMultiplyWithTransposedSecondOperand of(Variable<Matrix> A, Variable<Matrix> B);  }### Answer:
@Test void testMultiply() { double[] m1 = { 1, 2, 3, 4, 5, 6 }; double[] m2 = { 1, 4, 6, 2.1, 5, -1 }; double[] expected = { 27, 9.1, 60, 27.4 }; MatrixConstant A = new MatrixConstant(m1, 2, 3); MatrixConstant B = new MatrixConstant(m2, 2, 3); Variable<Matrix> product = new MatrixMultiplyWithTransposedSecondOperand(A, B); double[] result = ctx.forward(product).data(); assertArrayEquals(expected, result); }