当前位置:网站首页>Usage of torch.tensor.to
Usage of torch.tensor.to
2022-07-29 08:07:00 【00000cj】
Change data type torch.dtype Or equipment torch.device
x = torch.Tensor([1, 2, 3])
print(x.dtype) # torch.float32
x = x.to(torch.int64)
print(x.dtype) # torch.int64
print(x.device) # device(type='cpu')
print(x) # tensor([1, 2, 3])
cuda0 = torch.device('cuda:0')
x = x.to(cuda0)
print(x.device) # device(type='cuda', index=0)
print(x) # tensor([1, 2, 3], device='cuda:0')Reference resources
边栏推荐
- 下推分析的限制
- Simplefoc parameter adjustment 3-pid parameter setting strategy
- 【学术相关】为什么很多国内学者的AI的论文复现不了?
- Record of problems caused by PIP upgrade damage
- The new colleague wrote a few pieces of code, broke the system, and was blasted by the boss!
- Excellent urban design ~ good! Design # visualization radio station will be broadcast soon
- Unity - default rendering pipeline - sculpt shader
- [robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol
- SQL 面试碰到的一个问题
- [beauty of software engineering - column notes] "one question and one answer" issue 2 | 30 common software development problem-solving strategies
猜你喜欢
![[academic related] why can't many domestic scholars' AI papers be reproduced?](/img/1a/7b162741aa7ef09538355001bf45e7.png)
[academic related] why can't many domestic scholars' AI papers be reproduced?
![[cryoelectron microscope] relation4.0 - subtomogram tutorial](/img/5b/5364fbe68c495b67d9db5ed9bec2ac.png)
[cryoelectron microscope] relation4.0 - subtomogram tutorial

Unity beginner 3 - enemy movement control and setting of blood loss area (2D)

Redshift 2.6.41 for maya2018 watermark removal
![[beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?](/img/db/ef33a111bcb543f9704706049bccc2.png)
[beauty of software engineering - column notes] 21 | architecture design: can ordinary programmers also implement complex systems?

Unicode私人使用区域(Private Use Areas)

Keyboard processing in jetpack compose

sql判断语句的编写
![[cryptography experiment] 0x00 install NTL Library](/img/2a/03d95082a2a63238b475b3f7f3e13d.png)
[cryptography experiment] 0x00 install NTL Library

Some tools, plug-ins and software links are shared with you~
随机推荐
Data unit: bit, byte, word, word length
[beauty of software engineering - column notes] "one question and one answer" issue 2 | 30 common software development problem-solving strategies
Simplefoc parameter adjustment 1-torque control
Implementation of simple cubecap+fresnel shader in unity
Keyboard processing in jetpack compose
[beauty of software engineering - column notes] "one question and one answer" issue 3 | 18 common software development problem-solving strategies
Eps32+platform+arduino running lantern
Effective learning of medical image segmentation annotation based on noise pseudo tags and adversarial learning
随机抽奖转盘微信小程序项目源码
Research on autojs wechat: the final product of wechat automatic information sending robot (effective demonstration)
[skill accumulation] common expressions when writing emails
Measured waveform of boot capacitor short circuit and open circuit of buck circuit
Implementation of simple matcap+fresnel shader in unity
简易计算器微信小程序项目源码
Phased learning about the entry-level application of SQL Server statements - necessary for job hunting (I)
Redshift 2.6.41 for maya2018 watermark removal
Simplefoc+platformio stepping on the path of the pit
[beauty of software engineering - column notes] 26 | continuous delivery: how to release new versions to the production environment at any time?
[lecture notes] how to do in-depth learning in poor data?
torch.Tensor.to的用法