log_softmax¶
Computes \(\log(\text{softmax}(x))\) along a single dim.
ATen source: aten._log_softmax
Inputs¶
Name |
Description |
|---|---|
|
Tensor of any rank |
Attributes¶
Name |
Type |
Description |
|---|---|---|
|
|
Dimension along which |
|
|
Composite op version |
Output¶
Name |
Shape |
Description |
|---|---|---|
|
same as |
Same shape and dtype as |
Data types¶
fp16, fp32, bf16.
PyTorch example¶
import torch
from torch.nn.functional import log_softmax
input = torch.randn(2, 3)
output = log_softmax(input, dim=1)