- 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])
推薦閱讀
- Intel FPGA/CPLD設(shè)計(基礎(chǔ)篇)
- ATmega16單片機項目驅(qū)動教程
- 顯卡維修知識精解
- SDL Game Development
- 電腦組裝與維修從入門到精通(第2版)
- Getting Started with Qt 5
- INSTANT ForgedUI Starter
- 電腦軟硬件維修從入門到精通
- 筆記本電腦維修300問
- VMware Workstation:No Experience Necessary
- 單片機開發(fā)與典型工程項目實例詳解
- 嵌入式系統(tǒng)原理及應(yīng)用:基于ARM Cortex-M4體系結(jié)構(gòu)
- Mastering Quantum Computing with IBM QX
- Building Machine Learning Systems with Python
- 微服務(wù)實戰(zhàn)