---
title: "matrixMultiplication(primary:secondary:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/matrixmultiplication(primary:secondary:name:)"
---

# matrixMultiplication(primary:secondary:name:)

Computes the matrix multiplication of 2 input tensors with support for broadcasting.

## Declaration

```swift
func matrixMultiplication(primary primaryTensor: MPSGraphTensor, secondary secondaryTensor: MPSGraphTensor, name: String?) -> MPSGraphTensor
```

## Parameters

- `primaryTensor`: The left-hand side tensor.
- `secondaryTensor`: The right-hand side tensor.
- `name`: The name for the operation.

## Return Value

Return Value A valid tensor containing the product of the input matrices.
