---
title: SoftmaxParam
description: "| 属性 | 类型 | 默认值 | 描述 |"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/ascendtb/ascendtb_01_0339.html
sourcePath: /source/zh/canncommercial/900/API/ascendtb/ascendtb_01_0339.html
indexId: 39f0b03272b0a2a0ae5aff34e95165019c02b96ee3525abcb7dd71c32bf3619964
---
# SoftmaxParam

| 属性 | 类型 | 默认值 | 描述 |
| --- | --- | --- | --- |
| axes | List[int] | list() | \- |


#### 约束说明

axes的长度大小需小于DEFAULT_SVECTOR_SIZE，否则会抛出长度溢出异常。


#### 调用示例

```
import torch
import torch_atb  

def softmax():
    input_npu = torch.randn(2, 16, 256, dtype=torch.float32).npu()
    print("input: ", input_npu)
    softmax_param = torch_atb.SoftmaxParam(axes = [0])
    softmax = torch_atb.Operation(softmax_param)

    def softmax_run():
        softmax_outputs = softmax.forward([input_npu])
        return softmax_outputs

    outputs = softmax_run()
    print("outputs: ", outputs)

if __name__ == "__main__":
    softmax()
```
