官术网_书友最值得收藏!

  • Deep Learning with PyTorch
  • Vishnu Subramanian
  • 56字
  • 2021-06-24 19:16:23

Scalar (0-D tensors) 

A tensor containing only one element is called a scalar. It will generally be of type FloatTensor or LongTensor. At the time of writing, PyTorch does not have a special tensor with zero dimensions. So, we use a one-dimension tensor with one element, as follows:

x = torch.rand(10)
x.size()

Output - torch.Size([10])
主站蜘蛛池模板: 大理市| 喀喇沁旗| 治多县| 郯城县| 渝北区| 林州市| 昂仁县| 康平县| 青龙| 水富县| 乐至县| 金门县| 错那县| 嘉鱼县| 东乡| 桑日县| 察哈| 高安市| 扎赉特旗| 彩票| 平原县| 灵川县| 甘南县| 汉源县| 中阳县| 商河县| 天门市| 武鸣县| 汨罗市| 陕西省| 敖汉旗| 永靖县| 商水县| 金阳县| 浮梁县| 伊川县| 扬州市| 社旗县| 南京市| 定州市| 拜城县|