Softmax2d¶
- class torch.nn.Softmax2d(*args, **kwargs)[源代码][源代码]¶
对每个空间位置的特征应用 SoftMax。
当给定一个
Channels x Height x Width
的图像时,它将对每个位置 应用 Softmax 。- 形状
输入: 或 。
输出: 或 (与输入形状相同)
- 返回
一个与输入具有相同维度和形状的张量,其值在 [0, 1] 范围内
- 返回类型
None
示例
>>> m = nn.Softmax2d() >>> # you softmax over the 2nd dimension >>> input = torch.randn(2, 3, 12, 13) >>> output = m(input)