New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve "Defaults to" by putting to end of arg in docstring and ensuring backticks have proper spacing #18945
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1280,8 +1280,8 @@ def one_hot(x, num_classes, axis=-1, dtype=None): | |
x: Integer tensor to be encoded. The shape can be | ||
arbitrary, but the dtype should be integer. | ||
num_classes: Number of classes for the one-hot encoding. | ||
axis: Axis along which the encoding is performed. Defaults to | ||
`-1`, which represents the last axis. | ||
axis: Axis along which the encoding is performed. | ||
`-1` represents the last axis. Defaults to `-1`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, "which represents..." should go afterwards. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will move it if you request again, however there is ambiguity if "defaults to" isn't the final part of the argument. E.g., see https://github.com/keras-team/keras/blob/b6618f7/keras/utils/dataset_utils.py#L24-L28. Although there is no concrete specification of the Google doc format, in Sphinx they put "Defaults to" at the end of the argument: https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html |
||
dtype: (Optional) Data type of the output tensor. If not | ||
provided, it defaults to the default data type of the backend. | ||
|
||
|
@@ -1351,7 +1351,7 @@ def binary_crossentropy(target, output, from_logits=False): | |
probabilities. | ||
Set it to `True` if `output` represents logits; otherwise, | ||
set it to `False` if `output` represents probabilities. | ||
Defaults to`False`. | ||
Defaults to `False`. | ||
|
||
Returns: | ||
Integer tensor: The computed binary cross-entropy loss between | ||
|
@@ -1426,7 +1426,7 @@ def categorical_crossentropy(target, output, from_logits=False, axis=-1): | |
probabilities. | ||
Set it to `True` if `output` represents logits; otherwise, | ||
set it to `False` if `output` represents probabilities. | ||
Defaults to`False`. | ||
Defaults to `False`. | ||
axis: (optional) The axis along which the categorical cross-entropy | ||
is computed. | ||
Defaults to `-1`, which corresponds to the last dimension of | ||
|
@@ -1514,7 +1514,7 @@ class labels instead of one-hot encoded vectors. It measures the | |
or probabilities. | ||
Set it to `True` if `output` represents logits; otherwise, | ||
set it to `False` if `output` represents probabilities. | ||
Defaults to`False`. | ||
Defaults to `False`. | ||
axis: (optional) The axis along which the sparse categorical | ||
cross-entropy is computed. | ||
Defaults to `-1`, which corresponds to the last dimension | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "(scalar) if unspecified" should go afterwards