Pytorch handbook

Pytorch 中文文檔
https://pytorch-cn.readthedocs.io/zh/latest/package_references/torch/

Pytorch Tutorial 英文原版
https://pytorch.org/tutorials/index.html

Pytorch Tutorial 中文版
PyTorch 1.2 中文文檔 & 教程
https://pytorch.apachecn.org/docs/1.2/


PyTorch教程中文版
http://www.pytorch123.com/


Pytorch學習筆記(二)——Tensor https://www.cnblogs.com/cieusy/p/10565726.html

一、對Tensor的操作 從接口的角度講,對Tensor的操作可以分爲兩類:

(1)torch.function (2)tensor.function

比如torch.sum(a, b)實際上和a.sum(b)功能等價。

從存儲的角度講,對Tensor的操作也可以分爲兩類:

(1)不修改自身數據,如a.add(b),加法結果返回一個新的tensor;

(2)修改自身數據,如a.add_(b),加法結果仍存在a中,a被改變。

函數名以_結尾的稱爲inplace方式。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章