Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tensor fluid code transfer part2 #41096

Merged
merged 1 commit into from
Apr 13, 2022
Merged

tensor fluid code transfer part2 #41096

merged 1 commit into from
Apr 13, 2022

Conversation

zhiboniu
Copy link
Contributor

PR types

Others

PR changes

APIs

Describe

tensor fluid code transfer part2

@paddle-bot-old
Copy link

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@@ -14,27 +14,138 @@

from __future__ import print_function
import numpy as np
import math
from paddle.common_ops_import import fill_constant
from ..fluid.layers import utils
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to decouple with fluid.layers.utils or move them outside of fluid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个utils调用的是内部API,比如utils.convert_shape_to_list(shape)、utils.get_shape_tensor_inputs。
当前还没有新路径放置,所以最后再处理。

@@ -13,7 +13,7 @@
# limitations under the License.

import numpy as np
from ..fluid.layer_helper import LayerHelper
from ..framework import LayerHelper
from ..framework import _varbase_creator, _dygraph_tracer
from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype
from ..static import Variable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L21 below: from ..fluid.layers import transpose, cast # noqa: F401
can we delete transpose(not use below) and use paddle.cast instead of fluid.layers.cast

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件已在pr#40034中修改,这里只单独修改了LayerHelper

@@ -14,7 +14,7 @@
from __future__ import print_function
import numpy as np
import paddle
from ..fluid.layer_helper import LayerHelper
from ..framework import LayerHelper
from ..fluid.data_feeder import check_variable_and_dtype, check_type, check_dtype
from ..fluid import layers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only functions of layers.fill_constant and layers.where are used in this file, can we use paddle.full and paddle.where instead of?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件已在pr#40034中修改,这里只单独修改了LayerHelper

jeff41404
jeff41404 previously approved these changes Apr 11, 2022
Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, remind Todos

zhiqiu
zhiqiu previously approved these changes Apr 11, 2022
@zhiboniu zhiboniu dismissed stale reviews from zhiqiu and jeff41404 via 7e36214 April 11, 2022 12:34
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jzhang533 jzhang533 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeff41404 jeff41404 merged commit c239f15 into PaddlePaddle:develop Apr 13, 2022
lanxianghit pushed a commit that referenced this pull request Jun 22, 2022
cherry-pick #42750。

QA反馈,#42750 优化后,solov2模型性能可提升6%,故cherry-pick到2.3。因#41096 将linspace python实现从fluid.layers.tensor挪到了paddle.tensor.creation下,该pr不在release/2.3分支中,故将#42750 中python修改同步到fluid.layers.tensor.linspace中。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants