---
title: "encode(commandBuffer:inputMatrix:weightMatrix:biasVector:resultMatrix:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsmatrixfullyconnected/encode(commandbuffer:inputmatrix:weightmatrix:biasvector:resultmatrix:)"
---

# encode(commandBuffer:inputMatrix:weightMatrix:biasVector:resultMatrix:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, inputMatrix: MPSMatrix, weightMatrix: MPSMatrix, biasVector: MPSVector?, resultMatrix: MPSMatrix)
```
