Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the new features of PyTorch 1.3?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "what are the new features of PyTorch 1.3", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the new features of PyTorch 1.3" this article?

On October 10th, 2019.10, the PyTorch developers Conference opened in San Francisco, USA, where PyTorch 1.3 was released. The biggest highlights of this update are support for mobile devices (Mobile Supported), naming tensor (Named Tensors), quantization (Quantization), type promotion (Type Promotion) and so on. In addition, PyTorch officially opened up a number of new tools and libraries, covering interpretability, encryption, and many functions about image and voice. I will introduce them one by one below.

Installation of the CPU version of Windows:

Pip3 install torch==1.3.0+cpu torchvision==0.4.1+cpu-f https://download.pytorch.org/whl/torch_stable.html

For installation of other versions, please refer to:

Https://pytorch.org/get-started/locally/

PyTorch 1.3 has also added Cloud TPU and Aliyun support.

Mobile support (Mobile Support)

PyTorch 1.3 supports TorchScript to inference directly on the mobile side without any conversion. Of course, mobile training (train) is not supported at present.

In addition, some optimizations have been made for fp32 and int8:

-some fp32 operations are specifically optimized on ARM's CPU (based on Caffe2Go)

-some int8 operations are specifically optimized on ARM's CPU (based on QNNPACK)

The feature of PyTorch mobile support is that there is no new framework for mobile (compared to TensorFlow lite), all TorchScript API can be run directly on Android/iOS.

However, at present, it is only an experimental release, and it still needs to evolve to make PyTorch smaller and faster for specific scenarios.

Naming tensor (Named Tensor)

Named Tensor assigns a specific name to each dimension of Tensor, which makes Tensor easier to use. For example:

> tensor = torch.zeros (2,3, names= ('clocked,' N'))

Tensor ([[0.,0.,0.]

[0.,0.,0.], names= ('Clearing,' N'))

This creates a new Tensor for dim=2 with dimensions'C 'and' N', respectively, so that you can directly use'C 'and' N' to operate on Tensor instead of using previous unreadable operations such as axis=0 or axis=1.

Quantitative support

PyTorch 1.3supports the quantization operation of Tensor, and users can easily

X = torch.rand (10jue 1, dtype=torch.float32)

# xq is the quantized vector, and the data type is marked as quint8

Xq = torch.quantize_per_tensor (x, scale = 0.5, zero_point = 8, dtype=torch.quint8)

# and then convert back to floating point

Xdq = x.dequantize ()

These are all the contents of this article entitled "what are the New Features of PyTorch 1.3.Thank you for reading!" I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report