当前位置:网站首页>[pytorch learning] torch device
[pytorch learning] torch device
2022-07-01 09:09:00 【Enzo tried to smash the computer】
1. torch.device The meaning of representation
torch.device For and on behalf of torch.tensor The object assigned to the device
( To put it simply , Is assigned to you CPU still GPU On , And which one GPU On )
2. torch.device Parameter interpretation of
torch.device Contains a device type ('cpu’ or ’cuda’ Device type ) And the serial number of the optional device .
If the equipment serial number does not exist , Is the current device
for example ,torch.Tensor Build with equipment ’cuda’ The result is the same as ’cuda:X’, among X yes torch.cuda.current_device() Result .
3. structure torch.device Two ways
- Through strings
>>> torch.device('cpu')
device(type='cpu')
>>> torch.device('cuda:0')
device(type='cuda', index=0)
>>> torch.device('cuda') # current cuda device
device(type='cuda')
- In the form of string and device number
>>> torch.device('cpu', 0)
device(type='cpu', index=0)
>>> torch.device('cuda', 0)
device(type='cuda', index=0)
边栏推荐
- TV size and viewing distance
- 中小企业固定资产管理办法哪种好?
- LogBack
- 易点易动助力企业设备高效管理,提升设备利用率
- Key points of NFT supervision and overseas policies
- Football and basketball game score live broadcast platform source code /app development and construction project
- 【ESP 保姆级教程】疯狂毕设篇 —— 案例:基于物联网的GY906红外测温门禁刷卡系统
- Class loading
- Jetson nano installs tensorflow GPU and problem solving
- The jar package embedded with SQLite database is deployed by changing directories on the same machine, and the newly added database records are gone
猜你喜欢

Principles of Microcomputer - internal and external structure of microprocessor

Which method is good for the management of fixed assets of small and medium-sized enterprises?

Bird recognition app

2.3 【kaggle数据集 - dog breed 举例】数据预处理、重写Dataset、DataLoader读取数据

Nacos - Configuration Management

小鸟识别APP

【pytorch】nn.CrossEntropyLoss() 与 nn.NLLLoss()

3. Detailed explanation of Modbus communication protocol

NiO zero copy
![[MFC development (17)] advanced list control list control](/img/e8/24c52cb51defc6c96b43c2ef3232ff.png)
[MFC development (17)] advanced list control list control
随机推荐
Bimianhongfu queren()
Daily practice of C language - day 80: currency change
AVL树的理解和实现
Understand shallow replication and deep replication through code examples
How to manage fixed assets efficiently in one stop?
足球篮球体育比赛比分直播平台源码/app开发建设项目
【pytorch】2.4 卷积函数 nn.conv2d
通过 代码实例 理解 浅复制 与 深复制
大型工厂设备管理痛点和解决方案
[MFC development (17)] advanced list control list control
jeecg 重启报40001
钓鱼识别app
Principles of Microcomputer - Introduction
【电赛训练】红外光通信装置 2013年电赛真题
固定资产管理系统让企业动态掌握资产情况
Shell script case in statement
SDN_简单总结
What are the differences between the architecture a, R and m of arm V7, and in which fields are they applied?
易点易动助力企业设备高效管理,提升设备利用率
Key points of NFT supervision and overseas policies