diff --git a/python/paddle/fluid/dygraph/dygraph_to_static/tensor_shape_transformer.py b/python/paddle/fluid/dygraph/dygraph_to_static/tensor_shape_transformer.py index b7a2087d1f24d893fa7af4ee45c6011f23bebf09..5604a634a171b84b6fb2d208905936d8b897d230 100644 --- a/python/paddle/fluid/dygraph/dygraph_to_static/tensor_shape_transformer.py +++ b/python/paddle/fluid/dygraph/dygraph_to_static/tensor_shape_transformer.py @@ -37,6 +37,7 @@ class TensorShapeTransformer(gast.NodeTransformer): self.visit(self.root) def visit_Attribute(self, node): + self.generic_visit(node) if node.attr == 'shape': args = ast_to_source_code(node.value).strip() # NOTE(dev): we can deal with paddle.shape in this case, but it's