评价此页

torch.sparse.log_softmax#

torch.sparse.log_softmax(input, dim, *, dtype=None) Tensor#

应用 softmax 函数后取对数。

更多细节请参阅 softmax

参数
  • input (张量) – 输入

  • dim (int) – 将计算 softmax 的维度。

  • dtype (torch.dtype, 可选) – 返回张量的期望数据类型。如果指定,则在执行操作之前,输入张量将被强制转换为 dtype。这对于防止数据类型溢出很有用。默认值:None