Paddle 请教两个问题

piv4azn7  于 2021-12-07  发布在  Java
关注(0)|答案(4)|浏览(234)
  1. 在 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: |

  1. 当前develop分支里是不是 paddle.fluid.load=paddle.fluid.io.load=paddle.static.load, paddle.fluid.save=paddle.fluid.io.save=paddle.static.save? 均用于静态图?
cgh8pdjw

cgh8pdjw1#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

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 APIFAQGithub Issue and AI community to get the answer.Have a nice day!

vojdkbi0

vojdkbi02#

@starsblinking
1.参数都是persistable的,可能有非参数的普通variable也被是persistable,但是可以将参数设置为非persistable的
2.对的,都是别名的关系,static只能在静态图下用

hfwmuf9z

hfwmuf9z3#

总觉得,既然保存的目标是persistable的var,那只保留后一个判断就足够了,前面的是多余的

jum4pzuy

jum4pzuy4#

Are you satisfied with the resolution of your issue?

YES
No

相关问题