consistent nn. and nn.functional: part 5 docs (#12161)

This commit is contained in:
Stas Bekman
2021-06-14 13:34:32 -07:00
committed by GitHub
parent 88e84186e5
commit 040283170c
5 changed files with 9 additions and 9 deletions

View File

@@ -265,8 +265,8 @@ Let's apply the SoftMax activation to get predictions.
.. code-block::
>>> ## PYTORCH CODE
>>> import torch.nn.functional as F
>>> pt_predictions = F.softmax(pt_outputs.logits, dim=-1)
>>> from torch import nn
>>> pt_predictions = nn.functional.softmax(pt_outputs.logits, dim=-1)
>>> ## TENSORFLOW CODE
>>> import tensorflow as tf
>>> tf.nn.softmax(tf_outputs.logits, axis=-1)