当前位置:网站首页>torch.Tensor.to的用法
torch.Tensor.to的用法
2022-07-29 08:04:00 【00000cj】
更改数据类型torch.dtype或者设备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')参考
边栏推荐
- Realize the effect of changing some colors of a paragraph of text
- [note] the art of research (understand the importance of the problem)
- Limitations of push down analysis
- Data warehouse modeling, what is wide table? How to design? Advantages and disadvantages
- UE4 principle and difference between skylight and reflecting sphere
- Beautiful girls
- [beauty of software engineering - column notes] 25 | what methods can improve development efficiency?
- [lecture notes] how to do in-depth learning in poor data?
- Tle5012b+stm32f103c8t6 (bluepill) reading angle data
- Taiyuan bus route crawling
猜你喜欢

My entrepreneurial neighbors

Mqtt server setup and mqtt.fx testing

【学术相关】为什么很多国内学者的AI的论文复现不了?

Mutationobserver document learning
![[beauty of software engineering - column notes] 22 | how to do a good job in technology selection for the project?](/img/1a/72bfb3fef59c54188a823ead3a5390.png)
[beauty of software engineering - column notes] 22 | how to do a good job in technology selection for the project?
![[cryoelectron microscope | paper reading] emclarity: software for high-resolution cryoelectron tomography and sub fault averaging](/img/1e/9f05862288261e16a6b04508b9b292.png)
[cryoelectron microscope | paper reading] emclarity: software for high-resolution cryoelectron tomography and sub fault averaging

Up sampling deconvolution operation

C language data type
![[paper reading] tomoalign: a novel approach to correcting sample motion and 3D CTF in cryoet](/img/3a/75c211f21758ca2d9bb1a40d739d80.png)
[paper reading] tomoalign: a novel approach to correcting sample motion and 3D CTF in cryoet

Jump from mapper interface to mapping file XML in idea
随机推荐
The computer system has no standard tcp/ip port processing operations
关于pip升级损坏导致的问题记录
Jiamusi Market Supervision Bureau carried out special food safety network training on epidemic and insect prevention
[beauty of software engineering - column notes] 23 | Architect: programmers who don't want to be architects are not good programmers
How to draw an excellent architecture diagram
Pytorch's skill record
After the access database introduces DataGridView data, an error is displayed
In the MySQL connector of flynk CDC, the MySQL field is varbinary, which is officially
You study, I reward, 21 day learning challenge | waiting for you to fight
Amaze UI icon query
Crawl expression bag
Actual measurement of boot and pH pins of buck circuit
C language problems
[beauty of software engineering - column notes] 25 | what methods can improve development efficiency?
JVM garbage collection mechanism (GC)
Excellent urban design ~ good! Design # visualization radio station will be broadcast soon
Arduino uno error analysis avrdude: stk500_ recv(): programmer is not responding
Unity beginner 2 - tile making and world interaction (2D)
Basic introduction to pod
[deep learning] data preparation -pytorch custom image segmentation data set loading