-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
【Fluid Clean】 Rename paddle.fluid to paddle.base #56576
Conversation
1bd9c3d
to
b38d97a
Compare
${py_src} | ||
COMMENT | ||
"Replacing 'paddle.fluid' with 'paddle.base' generated by protobuf" | ||
COMMENT "Replace ${py_src}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处是由于当前proto文件存放在paddle/fluid/
目录下,在通过protoc工具自动转换成py文件时,文件内容中的import关系仍保持为包含fluid的路径;由于paddle/fluid
目录并不在本次改动范围内,不适合调整proto文件本身的位置。因此这里对生成的文件内的import路径做修改。
paddle/fluid/API.spec
Outdated
paddle.fluid.optimizer.PipelineOptimizer.minimize (ArgSpec(args=['self', 'loss', 'startup_program', 'parameter_list', 'no_grad_set'], varargs=None, keywords=None, defaults=(None, None, None)), ('document', '6adf97f83acf6453d4a6a4b1070f3754')) | ||
paddle.base.optimizer.PipelineOptimizer (paddle.base.optimizer.PipelineOptimizer, ('document', '2e55a29dbeb874934f7a1a1af3a22b8c')) | ||
paddle.base.optimizer.PipelineOptimizer.__init__ (ArgSpec(args=['self', 'optimizer', 'num_microbatches', 'start_cpu_core_id'], varargs=None, keywords=None, defaults=(1, 0)), ('document', '6adf97f83acf6453d4a6a4b1070f3754')) | ||
paddle.base.optimizer.PipelineOptimizer.minimize (ArgSpec(args=['self', 'loss', 'startup_program', 'parameter_list', 'no_grad_set'], varargs=None, keywords=None, defaults=(None, None, None)), ('document', '6adf97f83acf6453d4a6a4b1070f3754')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PipelineOptimizer
的当前路径是paddle.incubate.optimizer.PipelineOptimizer
paddle/scripts/paddle_build.sh
Outdated
# may be remove it later | ||
mkdir -p ${PADDLE_ROOT}/pr && cp -r ${PADDLE_ROOT}/build/pr_whl ${PADDLE_ROOT}/pr | ||
rm -rf ${PADDLE_ROOT}/build && mkdir -p ${PADDLE_ROOT}/build | ||
mv ${PADDLE_ROOT}/pr/pr_whl ${PADDLE_ROOT}/build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该PR编译后的产物和环境,由于会产出两份用于develop版本代码编译会造成问题;这段代码仅用于帮助通过build流水线检查,后续将移除
python/paddle/dataset/uci_housing.py
Outdated
parameter_tar = paddle.dataset.common.download( | ||
FLUID_URL_MODEL, 'uci_housing', FLUID_MD5_MODEL, 'fit_a_line.fluid.tar' | ||
FLUID_URL_MODEL, 'uci_housing', FLUID_MD5_MODEL, 'fit_a_line.base.tar' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件中是url和文件名以及函数名,不应该改动
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -158,7 +158,7 @@ def forward( | |||
# Note: | |||
# If not marked non_differentiable, all output tensors' attr `stop gradient` | |||
# will be reset to `False` in c++ backend. | |||
# See https://github.com/PaddlePaddle/Paddle/blob/9d62efb0e6e5373823039d9eda96cd5905426c0a/paddle/fluid/pybind/eager_py_layer.cc#L388 | |||
# See https://github.com/PaddlePaddle/Paddle/blob/9d62efb0e6e5373823039d9eda96cd5905426c0a/paddle/base/pybind/eager_py_layer.cc#L388 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请不要改动url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
2151375
to
383d8d2
Compare
python/paddle/dataset/uci_housing.py
Outdated
@@ -150,7 +150,7 @@ def reader(): | |||
return reader | |||
|
|||
|
|||
def fluid_model(): | |||
def base_model(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个文件中的两处均不应该改动:URL和函数名
3866b90
to
a4b6de9
Compare
paddle/fluid/pybind/tensor.cc
Outdated
@@ -393,7 +393,7 @@ void BindTensor(pybind11::module &m) { // NOLINT | |||
Examples: | |||
.. code-block:: python | |||
|
|||
import paddle.fluid as fluid | |||
import paddle.base as fluid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it better to use import paddle.base as base
, and replace fluid.Tensor()
with base.Tensor()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can other example code in this file be processed in the same way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks for pointing out the mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, works of Document Standardization will be done in open-source task: #55629
94be2eb
to
bda9596
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* rename fluid to base * fix setup and rename paddle.fluid * fix protobuf generated paddle.fluid * fix some errors * fix cmake depends * fix some error * try to fix cache error * fix codestyle && some doc error * remove build change * fix some error --------- Co-authored-by: XiangGao <jeff41404@gmail.com>
PR types
Breaking changes
PR changes
APIs
Description
python/paddle/fluid
目录将更名为python/paddle/base
,c++目录paddle/fluid
不受影响。这意味着fluid API的彻底退场,用户将不再能调用任何形式的fluid API,如对相关功能仍有需求,可以参考Paddle 1.8 与 Paddle 2.0 API 映射表 ,使用推荐的飞桨2.0API。