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

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])
主站蜘蛛池模板: 丘北县| 社旗县| 平陆县| 六枝特区| 邢台县| 南平市| 普定县| 开鲁县| 游戏| 东乡| 嘉定区| 金湖县| 北碚区| 云安县| 九龙坡区| 宜城市| 天祝| 旬阳县| 马龙县| 永新县| 颍上县| 拜泉县| 马公市| 雅安市| 正镶白旗| 屏山县| 晋江市| 聂拉木县| 建昌县| 扶绥县| 虎林市| 武川县| 东乡| 北票市| 通山县| 德钦县| 扎赉特旗| 阳信县| 定安县| 年辖:市辖区| 高淳县|