torch.nn.ParameterList

ParameterList的作用是在列表中保存参数。

ParameterList可以像普通Python列表一样进行索引,但是它包含的参数已经被正确注册,并且将被所有的Module方法都可见。

参数说明:

modules (list, 可选) – nn.Parameter要添加的列表

例子:

其实parameterList()就是一种和列表、元组之类一样的一种新的数据格式,用于保存神经网络权重及参数。

发布了943 篇原创文章 · 获赞 136 · 访问量 33万+

猜你喜欢

转载自blog.csdn.net/weixin_36670529/article/details/105037908
今日推荐