From 58ba6d06d6913e5348256a681b3222f19232710e Mon Sep 17 00:00:00 2001 From: RedContritio Date: Thu, 6 Jul 2023 14:22:44 +0000 Subject: [PATCH] update docstring --- python/paddle/fluid/reader.py | 7 +++---- python/paddle/io/reader.py | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/paddle/fluid/reader.py b/python/paddle/fluid/reader.py index c08fdedba3bcb8..d841c74049fab0 100644 --- a/python/paddle/fluid/reader.py +++ b/python/paddle/fluid/reader.py @@ -223,9 +223,10 @@ def from_generator( Returns: loader (DataLoader): the created DataLoader object. - Examples 1: + Examples: .. code-block:: python + :name static-data-loader-example-1 ''' Example in static graph mode @@ -344,10 +345,8 @@ def set_data_source(loader, places): else: train_non_iterable(exe, prog, loss, loader) - - Examples 2: - .. code-block:: python + :name static-data-loader-example-2 ''' Example in dynamic graph mode. diff --git a/python/paddle/io/reader.py b/python/paddle/io/reader.py index 861d1253dcfb97..7661745aeb9d66 100644 --- a/python/paddle/io/reader.py +++ b/python/paddle/io/reader.py @@ -320,6 +320,7 @@ class DataLoader: Examples: .. code-block:: python + :name data-loader-example import numpy as np