Skip to content

Commit c89e051

Browse files
authored
[Dy2St][Docs] fix error message in to_static doc (#58257)
1 parent 020f0a3 commit c89e051

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

python/paddle/jit/api.py

+16-12
Original file line numberDiff line numberDiff line change
@@ -240,24 +240,28 @@ def to_static(
240240
**kwargs,
241241
):
242242
"""
243-
Converts imperative dygraph APIs into declarative function APIs. Decorator
243+
Converts dynamic graph APIs into static graph function APIs. Decorator
244244
@to_static handles the Program and Executor of static graph mode and returns
245-
the result as dygraph Tensor(s). Users could use the returned dygraph
246-
Tensor(s) to do imperative training, inference, or other operations. If the
247-
decorated function calls other imperative function, the called one will be
248-
converted into declarative function as well.
245+
the result as dynamic graph Tensor(s). Users could use the returned dynamic
246+
graph Tensor(s) to do dynamic graph training, inference, or other operations.
247+
If the decorated function calls other dynamic graph function, the called one
248+
will be converted into static graph function as well.
249+
249250
Args:
250-
function (callable): callable imperative function.
251-
input_spec(list[InputSpec]|tuple[InputSpec]): list/tuple of InputSpec to specific the shape/dtype/name
252-
information of each input Tensor.
253-
build_strategy(BuildStrategy|None): This argument is used to compile the
251+
function (callable): Callable dynamic graph function. If it used as a
252+
decorator, the decorated function will be parsed as this parameter.
253+
input_spec (list[InputSpec]|tuple[InputSpec]): list/tuple of InputSpec to
254+
specific the shape/dtype/name information of each input Tensor.
255+
build_strategy (BuildStrategy|None): This argument is used to compile the
254256
converted program with the specified options, such as operators' fusion
255257
in the computational graph and memory optimization during the execution
256258
of the computational graph. For more information about build_strategy,
257259
please refer to :code:`paddle.static.BuildStrategy`. The default is None.
258-
backend(str, Optional): Specifies compilation backend, which can be `CINN` or None. When backend is `CINN`, CINN compiler will be used to speed up training and inference.
259-
kwargs: Support keys including `property`, set `property` to True if the fucntion is python property.
260-
260+
backend(str, Optional): Specifies compilation backend, which can be `CINN` or
261+
None. When backend is `CINN`, CINN compiler will be used to speed up
262+
training and inference.
263+
kwargs: Support keys including `property`, set `property` to True if the function
264+
is python property.
261265
262266
Returns:
263267
Tensor(s): containing the numerical result.

0 commit comments

Comments
 (0)