Practicing-Federated-Learning icon indicating copy to clipboard operation
Practicing-Federated-Learning copied to clipboard

勘误建议-P38- 3.2.2 Tensor与Python数据结构的转换

Open matthew-wei opened this issue 3 years ago • 4 comments

《联邦学习实战》

P38- 3.2.2 Tensor与Python数据结构的转换 代码:

a3 = torch.from_tensor(arr)
当修改为 a3 = troch.from_numpy(arr)

版次:2021年5月第1版 印次:2021年5月第1次印刷

matthew-wei avatar Jun 10 '21 03:06 matthew-wei

作者没有提供编写时 pytorch版本,所以除了这里,还有其他错误。 P38- 3.2.1 torch.normal(2,3) 在pytorch 1.8.1和1.9.0都是错误的

biobai avatar Jul 09 '21 06:07 biobai

书本用的pytorch版本是1.4

innovation-cat avatar Jul 09 '21 07:07 innovation-cat

pytorch版本会不断变化,很多API也会改变,尽量按官方的来吧,实体书会有滞后性

innovation-cat avatar Jul 09 '21 07:07 innovation-cat

《联邦学习实战》

P38- 3.2.2 Tensor与Python数据结构的转换 代码:

a3 = torch.from_tensor(arr) 当修改为 a3 = troch.from_numpy(arr)

版次:2021年5月第1版 印次:2021年5月第1次印刷

这个原稿用的都是from_numpy,可能是出版社编辑或者印刷错误,导致代码写的是from_tensor,正文内容写的是from_numpy,出版之后就已经向出版社反映了。谢谢

innovation-cat avatar Jul 09 '21 07:07 innovation-cat