首页 Paddle框架 帖子详情
如何像pytorch那样使用nn.Parameter来为模型增加可训练的参数 已解决
收藏
快速回复
Paddle框架 问答模型训练 872 4
如何像pytorch那样使用nn.Parameter来为模型增加可训练的参数 已解决
收藏
快速回复
Paddle框架 问答模型训练 872 4

如何像pytorch那样使用nn.Parameter来为模型增加可训练的参数

FutureSI
已解决
3# 回复于2021-11
用 Layer.create_parameter()
0
收藏
回复
全部评论(4)
时间顺序
FutureSI
#2 回复于2021-11

参考:

https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/Layer_cn.html

0
回复
FutureSI
#3 回复于2021-11

用 Layer.create_parameter()

0
回复
超级码立z
#4 回复于2021-12

import paddle
paddle.create_parameter(x.shape, dtype=str(x.numpy().dtype))

0
回复
pure00
#6 回复于2022-12

使用nn.Layer里面的create_parameter(),如果不使用 layers,paddle.create_parameter()

0
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户