当前位置:网站首页>The difference between torch.tensor and torch.tensor
The difference between torch.tensor and torch.tensor
2022-07-29 08:07:00 【00000cj】
Official explanation
torch.Tensor is an alias for the default tensor type (torch.FloatTensor).
namely torch.Tensor The default is float32 type , And cannot be changed during initialization .
and torch.tensor The data type will be automatically assigned according to the initial value , And you can specify the data type during initialization .
x = torch.Tensor([1, 2, 3])
y = torch.tensor([1, 2, 3])
z = torch.tensor([1, 2, 3], dtype=torch.float16)
print(x.dtype) # torch.float32
print(y.dtype) # torch.int64
print(z.dtype) # torch.float16Reference resources
Difference between torch.tensor and torch.Tensor - PyTorch Forums
边栏推荐
- [note] the art of research - (tell a good story and argument)
- Use the cloud code to crack the problem of authentication code encountered during login
- [beauty of software engineering - column notes] 28 | what is the core competitiveness of software engineers? (next)
- Explanation and closing method of server 135, 137, 138, 139, 445 and other ports
- My entrepreneurial neighbors
- [cryoelectron microscope | paper reading] emclarity: software for high-resolution cryoelectron tomography and sub fault averaging
- Unity beginner 3 - enemy movement control and setting of blood loss area (2D)
- C language problems
- [beauty of software engineering - column notes] 26 | continuous delivery: how to release new versions to the production environment at any time?
- [beauty of software engineering - column notes] 30 | make good use of source code management tools to make your collaboration more efficient
猜你喜欢

(视频+图文)机器学习入门系列-第5章 机器学习实践

网络安全之安全基线

Cyberpunk special effect shader

Unity Shader学习(六)实现雷达扫描效果

Some thoughts on growing into an architect
![[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?
![[beauty of software engineering - column notes]](/img/b9/43db3fdfe1d9f08035668a66da37e2.png)
[beauty of software engineering - column notes] "one question and one answer" issue 3 | 18 common software development problem-solving strategies

Tcp/ip five layer reference model and corresponding typical devices and IPv6

Simplefoc parameter adjustment 1-torque control

How to draw an excellent architecture diagram
随机推荐
Autojs微信研究:微信自动发送信息机器人最终成品(有效果演示)
CentOS deploy PostgreSQL 13
torch.Tensor.to的用法
Crawl expression bag
Chapter contents of the romance of the Three Kingdoms
Mysql rownum 实现
Convert source package to RPM package
【学术相关】为什么很多国内学者的AI的论文复现不了?
[robomaster] control RM motor from scratch (2) -can communication principle and electric regulation communication protocol
关于pip升级损坏导致的问题记录
Dynamic Thresholds Buffer Management in a Shared Buffer Packet Switch论文总结
An optimal buffer management scheme with dynamic thresholds paper summary
Si12t and si14t low power capacitive touch chips
Unicode私人使用区域(Private Use Areas)
Unity beginner 4 - frame animation and protagonist attack (2D)
Vmstat memory consumption query
Simplefoc parameter adjustment 2- speed and position control
CDM - code division multiplexing (easy to understand)
An Optimal Buffer Management Scheme with Dynamic Thresholds论文总结
Resize2fs: bad magic number in super block