- 在 test_static_save_load.py 中出现了多处 "if isinstance(var, framework.Parameter) or var.persistable:" , 请问 这里 "isinstance(var, framework.Parameter)" 的作用是什么呢? 直接 “if var.persistable:" 可以吗?什么情况下or的前面为真后面为假呢?
Paddle/python/paddle/fluid/tests/unittests/test_static_save_load.py
Line 309 in 18ecd43
| | ifisinstance(var, framework.Parameter) orvar.persistable: |
- 当前develop分支里是不是 paddle.fluid.load=paddle.fluid.io.load=paddle.static.load, paddle.fluid.save=paddle.fluid.io.save=paddle.static.save? 均用于静态图?
4条答案
按热度按时间cgh8pdjw1#
您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档、常见问题、历史Issue、AI社区来寻求解答。祝您生活愉快~
Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the API,FAQ,Github Issue and AI community to get the answer.Have a nice day!
vojdkbi02#
@starsblinking
1.参数都是persistable的,可能有非参数的普通variable也被是persistable,但是可以将参数设置为非persistable的
2.对的,都是别名的关系,static只能在静态图下用
hfwmuf9z3#
总觉得,既然保存的目标是persistable的var,那只保留后一个判断就足够了,前面的是多余的
jum4pzuy4#
Are you satisfied with the resolution of your issue?
YES
No