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

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])
主站蜘蛛池模板: 湖州市| 武夷山市| 三台县| 龙井市| 郸城县| 揭阳市| 西平县| 平乡县| 尼木县| 鹤山市| 邹平县| 徐水县| 巫溪县| 清流县| 江华| 昭平县| 新平| 永顺县| 平山县| 衡阳市| 宁波市| 马山县| 靖边县| 鸡西市| 郁南县| 麻江县| 澜沧| 冀州市| 含山县| 黄石市| 巴中市| 临桂县| 襄樊市| 明光市| 抚顺市| 综艺| 宝鸡市| 旺苍县| 桐城市| 隆德县| 汝城县|