From 3a8bef1d4132c4cd8c008747324936fd8a87b6ce Mon Sep 17 00:00:00 2001 From: liym27 <33742067+liym27@users.noreply.github.com> Date: Wed, 30 Sep 2020 11:10:16 +0800 Subject: [PATCH] [Dynamic-to-Static] Refine 2.0rc assign: paddle.nn.functional.assign (#27650) --- .../fluid/dygraph/dygraph_to_static/basic_api_transformer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/basic_api_transformer.py b/python/paddle/fluid/dygraph/dygraph_to_static/basic_api_transformer.py index 9334c15f7bc..cf5723a7463 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/basic_api_transformer.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/basic_api_transformer.py @@ -116,14 +116,14 @@ def is_to_variable(node): def to_assign_node(node): - # Transform dygraph api `fluid.dygraph.to_variable` alias `paddle.to_tensor` to static api `fluid.layers.assign`. + # Transform dygraph api `fluid.dygraph.to_variable` alias `paddle.to_tensor` to static api `paddle.nn.functional.assign`. # NOTE: # 1. Api `to_variable` supports data type {float16, float32, float64, int16, int32, int64, uint8, uint16}, # but api `assign` only supports {float32, float64, int32, int64, bool}; # 2. If the input of api `assign` is numpy.ndarray, its size cannot be greater than 1024 * 1024. assert isinstance(node, gast.Call) - assign_api = gast.parse('fluid.layers.assign').body[0].value + assign_api = gast.parse('paddle.nn.functional.assign').body[0].value node.func = assign_api if node.args: -- GitLab