Repository navigation
【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.
此处是由于当前proto文件存放在paddle/fluid/目录下,在通过protoc工具自动转换成py文件时,文件内容中的import关系仍保持为包含fluid的路径;由于paddle/fluid目录并不在本次改动范围内,不适合调整proto文件本身的位置。因此这里对生成的文件内的import路径做修改。
| 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.
PipelineOptimizer的当前路径是paddle.incubate.optimizer.PipelineOptimizer
| # 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.
该PR编译后的产物和环境,由于会产出两份用于develop版本代码编译会造成问题;这段代码仅用于帮助通过build流水线检查,后续将移除
| def base_model(): | ||
| 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.
这个文件中是url和文件名以及函数名,不应该改动
| # 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 |
2151375 to
383d8d2
Compare
|
|
||
|
|
||
| def fluid_model(): | ||
| def base_model(): |
3866b90 to
a4b6de9
Compare
| .. code-block:: python | ||
|
|
||
| import paddle.fluid as fluid | ||
| import paddle.base as fluid |
There was a problem hiding this comment.
is it better to use import paddle.base as base, and replace fluid.Tensor() with base.Tensor() ?
There was a problem hiding this comment.
Can other example code in this file be processed in the same way
There was a problem hiding this comment.
done, thanks for pointing out the mistake.
There was a problem hiding this comment.
Yes, works of Document Standardization will be done in open-source task: #55629
94be2eb to
bda9596
Compare
* 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。