---
title: "softMax(with:axis:name:)"
framework: metalperformanceshadersgraph
role: symbol
role_heading: Instance Method
path: "metalperformanceshadersgraph/mpsgraph/softmax(with:axis:name:)"
---

# softMax(with:axis:name:)

Computes the softmax function on the input tensor along the specified axis.

## Declaration

```swift
func softMax(with tensor: MPSGraphTensor, axis: Int, name: String?) -> MPSGraphTensor
```

## Parameters

- `tensor`: The input tensor.
- `axis`: The axis along which softmax is computed.
- `name`: The name for the operation.

## Return Value

Return Value A valid MPSGraphTensor object
