From 61f5341a064426d909cde3ed625781d7e6aab594 Mon Sep 17 00:00:00 2001 From: liym27 Date: Mon, 28 Sep 2020 10:54:49 +0800 Subject: [PATCH] [Dynamic-to-Static] Refine 2.0rc assign: paddle.nn.functional.assign Change-Id: I395f00d1295fc2fcf66e34146e2ab8b54ff7ba64 --- .../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 9334c15f7b..cf5723a746 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