---
title: "softmax(alongAxis:)"
framework: coreml
role: symbol
role_heading: Instance Method
path: "coreml/mltensor/softmax(alongaxis:)"
---

# softmax(alongAxis:)

Computes the softmax of the specified tensor along the specified axis.

## Declaration

```swift
func softmax(alongAxis axis: Int = -1) -> MLTensor
```

## Parameters

- `axis`: The axis along which softmax will be computed.

## Return Value

Return Value A new tensor with the same shape and scalar type.
