Skip to content

Commit

Permalink
[Docathon][Fix System Message No.3、9、14、15] (#58664)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieHuang2008 authored Nov 30, 2023
1 parent 09401e6 commit 6e5aad0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions python/paddle/amp/debugging.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ def enable_operator_stats_collection():
Examples:
.. code-block:: python
>>> # doctest: +REQUIRES(env:GPU)
>>> import paddle
>>> paddle.device.set_device('gpu')
Expand Down
4 changes: 4 additions & 0 deletions python/paddle/framework/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,18 @@ def seed(seed):
def get_rng_state(device=None):
"""
Get all random states of random generators of specified device.
Args:
device(str): This parameter determines the specific running device.
It can be ``cpu``, ``gpu``, ``xpu``, Default is None.
If None, return the generators of current device (specified by ``set_device``).
Returns:
GeneratorState: object.
Examples:
.. code-block:: python
>>> import paddle
>>> sts = paddle.get_rng_state()
"""
Expand Down
3 changes: 3 additions & 0 deletions python/paddle/hapi/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,7 @@ def fit(
.. code-block:: python
:name: code-example3
>>> # doctest: +TIMEOUT(80)
>>> import paddle
>>> import paddle.vision.transforms as T
>>> from paddle.vision.datasets import MNIST
Expand Down Expand Up @@ -1861,12 +1862,14 @@ def fit(
... batch_size=64,
... save_dir='mnist_checkpoint')
...
2. An example use DataLoader, batch size and shuffle is set in
DataLoader.
.. code-block:: python
:name: code-example4
>>> # doctest: +TIMEOUT(80)
>>> import paddle
>>> import paddle.vision.transforms as T
>>> from paddle.vision.datasets import MNIST
Expand Down
16 changes: 8 additions & 8 deletions python/paddle/nn/layer/loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,18 +1742,18 @@ class TripletMarginWithDistanceLoss(Layer):
For more information, please refer to :ref:`api_guide_Name`.
Shapes:
input (Tensor):Input tensor, the data type is float32 or float64.
the shape is [N, \*], N is batch size and `\*` means any number of additional dimensions, available dtype is float32, float64.
- input (Tensor):Input tensor, the data type is float32 or float64.
the shape is [N, \*], N is batch size and `\*` means any number of additional dimensions, available dtype is float32, float64.
positive (Tensor):Positive tensor, the data type is float32 or float64.
The shape of label is the same as the shape of input.
- positive (Tensor):Positive tensor, the data type is float32 or float64.
The shape of label is the same as the shape of input.
negative (Tensor):Negative tensor, the data type is float32 or float64.
The shape of label is the same as the shape of input.
- negative (Tensor):Negative tensor, the data type is float32 or float64.
The shape of label is the same as the shape of input.
output(Tensor): The tensor variable storing the triplet_margin_with_distance_loss of input and positive and negative.
- output(Tensor): The tensor variable storing the triplet_margin_with_distance_loss of input and positive and negative.
Return
Return:
A callable object of TripletMarginWithDistanceLoss
Examples:
Expand Down

0 comments on commit 6e5aad0

Please sign in to comment.