国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【PyTorch】Tensor&Variable

2022-09-09 22:33 作者:安然Nano  | 我要投稿

從重新過一遍PyTorch,記錄會稍晚同步到blog.qhpersonal.top

Initializing a Tensor

Attribute of Tensor

Three attributs is stored: shap, datatype, the device

Tensor and Numpy Conversions

numpy() : Tensor --> Numpy

torch.from_numpy(): Numpy --> Tensor

Operation on Tensor

tensor.to("cuda"): To GPU

cat(): Connect

stack(): Superposition. And stack make the dim up one.

Arithmetic Operations

Multiplication

matrix: tenser @ tensor, tensor.matmul() ? ?// tensor.mm() only use two matrix mul

element-wise product: tensor * tensor, torch.mul()

Others

tensor.sum(): Sum by the specified dim

.item(): single-element tensors --> python numerical value

tensor.add_(): add ? and store the result

參考資料:

[1]Welcome?to?PyTorch Tutorials[EB/OL]. (2022-09-09)[2022-09-09]. https://pytorch.org/tutorials.


【PyTorch】Tensor&Variable的評論 (共 條)

分享到微博請遵守國家法律
奉化市| 浏阳市| 诸城市| 永丰县| 蒙山县| 平塘县| 海丰县| 门源| 阳春市| 余干县| 黄浦区| 永修县| 揭东县| 当阳市| 长子县| 望都县| 同德县| 尖扎县| 温州市| 达日县| 思南县| 武清区| 南雄市| 木里| 常熟市| 光泽县| 桦南县| 郓城县| 山丹县| 涪陵区| 盐源县| 东城区| 梅河口市| 普陀区| 土默特右旗| 昌江| 分宜县| 米易县| 富顺县| 庆云县| 葫芦岛市|