[Doc] Add weight dtype in torch.nn.CrossEntropyLoss (#110998)

Fixes #101213

Pull Request resolved: https://github.com/pytorch/pytorch/pull/110998
Approved by: https://github.com/albanD
This commit is contained in:
isdanni
2023-10-11 19:52:10 +00:00
committed by PyTorch MergeBot
parent d589106bcd
commit 6c7013a3dc

View File

@ -1106,7 +1106,7 @@ class CrossEntropyLoss(_WeightedLoss):
Args:
weight (Tensor, optional): a manual rescaling weight given to each class.
If given, has to be a Tensor of size `C`
If given, has to be a Tensor of size `C` and floating point dtype
size_average (bool, optional): Deprecated (see :attr:`reduction`). By default,
the losses are averaged over each loss element in the batch. Note that for
some losses, there are multiple elements per sample. If the field :attr:`size_average`