From f3dfc2c7b127ca17221f90f324276edd3d4c5b3e Mon Sep 17 00:00:00 2001 From: liym27 Date: Tue, 18 Aug 2020 11:15:51 +0800 Subject: [PATCH] remove import reshape. test=develop Change-Id: Ic5074bd843ebdf754ff86117f7795a77c7fef8d5 --- python/paddle/tensor/manipulation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/paddle/tensor/manipulation.py b/python/paddle/tensor/manipulation.py index c4feace468ac3..126bdcdc9d0ac 100644 --- a/python/paddle/tensor/manipulation.py +++ b/python/paddle/tensor/manipulation.py @@ -14,7 +14,7 @@ from __future__ import print_function -from ..fluid.layers import core, reshape +from ..fluid.layers import core from ..fluid.layer_helper import LayerHelper from ..fluid.framework import Variable, OpProtoHolder, in_dygraph_mode, convert_np_dtype_to_dtype_ from ..fluid.data_feeder import convert_dtype, check_variable_and_dtype, check_type, check_dtype @@ -23,7 +23,7 @@ import numpy as np # TODO: define functions to manipulate a tensor from ..fluid.layers import cast #DEFINE_ALIAS -from ..fluid.layers import reshape #DEFINE_ALIAS +from ..fluid.layers import expand_as #DEFINE_ALIAS from ..fluid.layers import scatter #DEFINE_ALIAS from ..fluid.layers import slice #DEFINE_ALIAS from ..fluid.layers import strided_slice #DEFINE_ALIAS @@ -998,8 +998,10 @@ def get_attr_expand_shape(list_expand_shape): type='expand_v2', inputs=inputs, outputs={'Out': out}, attrs=attrs) return out + broadcast_to = expand + def reshape(x, shape, name=None): """ :alias_main: paddle.reshape