You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/paddle/jit/api.py
+16-12
Original file line number
Diff line number
Diff line change
@@ -240,24 +240,28 @@ def to_static(
240
240
**kwargs,
241
241
):
242
242
"""
243
-
Converts imperative dygraph APIs into declarative function APIs. Decorator
243
+
Converts dynamic graph APIs into static graph function APIs. Decorator
244
244
@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
+
249
250
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
254
256
converted program with the specified options, such as operators' fusion
255
257
in the computational graph and memory optimization during the execution
256
258
of the computational graph. For more information about build_strategy,
257
259
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
0 commit comments