EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

PyTorch Versions

By Priya PedamkarPriya Pedamkar

Home » Data Science » Data Science Tutorials » Machine Learning Tutorial » PyTorch Versions

pytorch versions

Introduction to PyTorch Versions

PyTorch is one of the most preferred deep learning frameworks due to its ease of use and simplicity. PyTorch has its own community of developers who are working to improve it with new features and fix the critical bugs introduced with these new features. PyTorch has evolved with each release and used mostly for providing NumPy like operation on a multi-dimensional array with GPU so the computation is faster and builds a deep neural network for computer vision or natural language processing. The goal of each new release is to provide the user better and cleaner interface to build Artificial intelligence models. The latest stable version released by Facebook of PyTorch is 1.3 builds, this is currently tested and supported version.

Different Versions of PyTorch

Here we discuss the different versions of Pytorch released with the system configuration required and mainly focus on current stable release v1.3 as this is the one used in market and research community currently:

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

1. Old Version – PyTorch Versions < 1.0.0

In the very first release of PyTorch, Facebook combined Python and Torch libraries to create an open-source framework that can also be operated on CUDA and Nvidia GPU. PyTorch mainly uses Tensors (torch.Tensors) to store and operate on the Multi-Dimensional array. PyTorch released the first version as 0.1.12 in public. 0.4 version was one of the most significant released version with core changes.

In PyTorch v0.4 version has added the support for Windows, added features to support the use of RNN in ONNX (Open Neural Network Exchange). It has C++/Cuda extensions for user’s use. Also in 0.4 version provide support for writing device-agnostic code. Tensors and variables have been merged in the 0.4 release as well as operations can return 0-Dimensional tensors. To install all the old version through conda or mini conda use below commands:

In the below command, the user can replace ‘0.2.0’ with his desired version like ‘0.4.0 or 0.4.1’ And replace cuda9 by cuda8, cuda7.5, etc.

conda install pytorch=0.2.0 cuda90 -c pytorch

PyTorch libraries are also available in GitHub and users can check out the older version of PyTorch and build it. User can replace ‘0.2.0’ with his desired version: git checkout v0.2.0. Users can also download the required libraries for macOS or for Windows. User can download the respective OS libraries from the below URL from the official website of:

  • Windows Binaries:
    https://pytorch.org/get-started/previous-versions/#windows-binaries
  • Mac Binaries:
    https://pytorch.org/get-started/previous-versions/#mac-and-misc-binaries

2. PyTorch Version 1.0 to 1.2

Before the 1.0 version of the code was written in Pytorch, the Python VM environment was needed to run this app. In 1.0 version python function and classes are provided with torch.jit and to separate python code, this function/classes can be compiled into high-level representation. The main goal during the release of version from 1.0 to 1.2 was to combine features of Pytorch, ONNX and caffe2 framework into a single framework for seamless integration from research to production deployment. Some of the features added in version 1.0 are as below:

  • Easy to integrate C++ function with Python.
  • It separates the AI model from code by providing two modes:
    • Eager Mode: Mostly used for research as it is simple, debuggable and can use any python library. It needs a Python environment to run.
    • Script Mode: Model can run without a Python interpreter. This is a production deployment mode it has no python dependency and code is an optimizable subset of Python.
  • A model can run on servers, GPU or TPUs.

In below command the user can replace ‘1.2.0’ with his desired version ‘1.0.0 or 1.0.1’ And in torchvision replace 0.4.0 by 0.3.0, 0.2.2, etc based on it.

Popular Course in this category
Sale
Machine Learning Training (20 Courses, 29+ Projects)19 Online Courses | 29 Hands-on Projects | 178+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.7 (14,316 ratings)
Course Price

View Course

Related Courses
Deep Learning Training (17 Courses, 24+ Projects)Artificial Intelligence Training (5 Courses, 2 Project)

conda install pytorch==1.2.0 torchvision==0.4.0 -c pytorch

3. Latest PyTorch Version

Facebook has released the latest version of PyTorch in 2019. This new version is packed with new changes and bug fixes. Some of the new exciting features are supported for mobile, transparency, named tensors and quantization to meet the needs of researchers. I will be explaining in brief about these new features with some other information.

PyTorch Named Tensors

In prior 1.3 released PyTorch which did not support the suggestion of dimensions, broadcasting based on position or no information related to type was there in documentation with named tensors. PyTorch has overcome this debacle. PyTorch has added Named tensor as a feature so that users can access tensor dimensions using direct names. Previously while performing simple task users had to know the general structure of the now by broadcasting name of the dimensions user can rearrange the dimensions as required.

Named tensors also support error check on the name of the parameter to check dimension name match with the parameter or not.

Example:

import torch
data_sample = torch.randn(100, 3, 250, 600 , names=('N', 'C', 'H', 'W'))

Here, N is Number of Batches, C is Number of the channel, H is the height of the image, W is the width of the image.

PyTorch Quantization

Quantization is a technique to perform high-precision computation and storage operation in reduced precision. Quantization is already supported in TensorFlow but in PyTorch it has been added recently. To develop ML application and deploy efficiently to a server or on-premise resources 8-bit model quantization is added. PyTorch currently supports three types of Quantization models as Post Training, Dynamic Quantization, and Quantization Aware Training also for quantization PyTorch has introduced three new datatypes as torch.quint8 — 8-bit unsigned integer, torch.qint8 — 8-bit signed integer and torch.qint32 — 32-bit signed integer.

To run quantized operations PyTorch uses x86 CPUs with AVX2 support and ARM CPUs.

import torch
m = nn.quantized.ReLU()
input = torch.randn(2)
input = torch.quantize_per_tensor(input, 1.0, 0, dtype=torch.qint32)

PyTorch Mobile Support

Quantization is used while developing ML application so that PyTorch models can be deployed to Mobile or Other Devices. In PyTorch 1.3 the developer has added end to end workflow APIs for Android and iOS. This was done to reduce the latency and provide security on the edge node. It is an early-stage developer who is still working on this development with optimized computation, performance, and coverage on mobile CPUs and GPUs.

Apart from the above three features, there are some features added like support for PyTorch on Google colab. Support for tensorboard and performance improvement in the Autograd engine. Some new tools for model privacy, interpretability, and tools to support a multi-modal AI system.

Conclusion

In conclusion, PyTorch is the most used deep learning framework with support to all state of the art technology. As developers are continuously working on improving the PyTorch you can assume that there will be many more releases with exciting new features that will get added. So learning PyTorch to create machine learning or deep learning application will be beneficial for aspiring AI enthusiasts as this is one of the well documented and supported frameworks.

Recommended Articles

This is a guide to PyTorch Versions. Here we discuss the Introduction and different versions of PyTorch which include old PyTorch version< 1.0.0, PyTorch version 1.0 to 1.2, and latest PyTorch version. You may also look at the following articles to learn more –

  1. Statistical Data Analysis Techniques
  2. Scala Versions with Features
  3. Types of Typescript Versions
  4. Top PHP Versions
  5. PyTorch vs Keras | Top Differences

Machine Learning Training (17 Courses, 27+ Projects)

19 Online Courses

29 Hands-on Projects

178+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
Machine Learning Tutorial
  • PyTorch
    • PyTorch Tensors
    • What is PyTorch?
    • PyTorch MSELoss()
    • PyTorch NLLLOSS
    • PyTorch MaxPool2d
    • PyTorch Pretrained Models
    • PyTorch Squeeze
    • PyTorch Reinforcement Learning
    • PyTorch zero_grad
    • PyTorch norm
    • PyTorch VAE
    • PyTorch Early Stopping
    • PyTorch requires_grad
    • PyTorch MNIST
    • PyTorch Conv2d
    • Dataset Pytorch
    • PyTorch tanh
    • PyTorch bmm
    • PyTorch profiler
    • PyTorch unsqueeze
    • PyTorch adam
    • PyTorch backward
    • PyTorch concatenate
    • PyTorch Embedding
    • PyTorch Tensor to NumPy
    • PyTorch Normalize
    • PyTorch ReLU
    • PyTorch Autograd
    • PyTorch Transpose
    • PyTorch Object Detection
    • PyTorch Autoencoder
    • PyTorch Loss
    • PyTorch repeat
    • PyTorch gather
    • PyTorch sequential
    • PyTorch U-NET
    • PyTorch Sigmoid
    • PyTorch Neural Network
    • PyTorch Quantization
    • PyTorch Ignite
    • PyTorch Versions
    • PyTorch TensorBoard
    • PyTorch Dropout
    • PyTorch Model
    • PyTorch optimizer
    • PyTorch ResNet
    • PyTorch CNN
    • PyTorch Detach
    • Single Layer Perceptron
    • PyTorch vs Keras
    • torch.nn Module
  • Basic
    • Introduction To Machine Learning
    • What is Machine Learning?
    • Uses of Machine Learning
    • Applications of Machine Learning
    • Naive Bayes in Machine Learning
    • Dataset Labelling
    • DataSet Example
    • Dataset ZFS
    • Careers in Machine Learning
    • What is Machine Cycle?
    • Machine Learning Feature
    • Machine Learning Programming Languages
    • What is Kernel in Machine Learning
    • Machine Learning Tools
    • Machine Learning Models
    • Machine Learning Platform
    • Machine Learning Libraries
    • Machine Learning Life Cycle
    • Machine Learning System
    • Machine Learning Datasets
    • Machine Learning Certifications
    • Machine Learning Python vs R
    • Optimization for Machine Learning
    • Types of Machine Learning
    • Machine Learning Methods
    • Machine Learning Software
    • Machine Learning Techniques
    • Machine Learning Feature Selection
    • Ensemble Methods in Machine Learning
    • Support Vector Machine in Machine Learning
    • Decision Making Techniques
    • Restricted Boltzmann Machine
    • Regularization Machine Learning
    • What is Regression?
    • What is Linear Regression?
    • Dataset for Linear Regression
    • Decision tree limitations
    • What is Decision Tree?
    • What is Random Forest
  • Algorithms
    • Machine Learning Algorithms
    • Apriori Algorithm in Machine Learning
    • Types of Machine Learning Algorithms
    • Bayes Theorem
    • AdaBoost Algorithm
    • Classification Algorithms
    • Clustering Algorithm
    • Gradient Boosting Algorithm
    • Mean Shift Algorithm
    • Hierarchical Clustering Algorithm
    • Hierarchical Clustering Agglomerative
    • What is a Greedy Algorithm?
    • What is Genetic Algorithm?
    • Random Forest Algorithm
    • Nearest Neighbors Algorithm
    • Weak Law of Large Numbers
    • Ray Tracing Algorithm
    • SVM Algorithm
    • Naive Bayes Algorithm
    • Neural Network Algorithms
    • Boosting Algorithm
    • XGBoost Algorithm
    • Pattern Searching
    • Loss Functions in Machine Learning
    • Decision Tree in Machine Learning
    • Hyperparameter Machine Learning
    • Unsupervised Machine Learning
    • K- Means Clustering Algorithm
    • KNN Algorithm
    • Monty Hall Problem
  • Supervised
    • What is Supervised Learning
    • Supervised Machine Learning
    • Supervised Machine Learning Algorithms
    • Perceptron Learning Algorithm
    • Simple Linear Regression
    • Polynomial Regression
    • Multivariate Regression
    • Regression in Machine Learning
    • Hierarchical Clustering Analysis
    • Linear Regression Analysis
    • Support Vector Regression
    • Multiple Linear Regression
    • Linear Algebra in Machine Learning
    • Statistics for Machine Learning
    • What is Regression Analysis?
    • Clustering Methods
    • Backward Elimination
    • Ensemble Techniques
    • Bagging and Boosting
    • Linear Regression Modeling
    • What is Reinforcement Learning
  • Classification
    • Kernel Methods in Machine Learning
    • Clustering in Machine Learning
    • Machine Learning Architecture
    • Automation Anywhere Architecture
    • Machine Learning C++ Library
    • Machine Learning Frameworks
    • Data Preprocessing in Machine Learning
    • Data Science Machine Learning
    • Classification of Neural Network
    • Neural Network Machine Learning
    • What is Convolutional Neural Network?
    • Single Layer Neural Network
    • Kernel Methods
    • Forward and Backward Chaining
    • Forward Chaining
    • Backward Chaining
  • Deep Learning
    • What Is Deep learning
    • Overviews Deep Learning
    • Application of Deep Learning
    • Careers in Deep Learnings
    • Deep Learning Frameworks
    • Deep Learning Model
    • Deep Learning Algorithms
    • Deep Learning Technique
    • Deep Learning Networks
    • Deep Learning Libraries
    • Deep Learning Toolbox
    • Types of Neural Networks
    • Convolutional Neural Networks
    • Create Decision Tree
    • Deep Learning for NLP
    • Caffe Deep Learning
    • Deep Learning with TensorFlow
  • RPA
    • What is RPA
    • What is Robotics?
    • Benefits of RPA
    • RPA Applications
    • Types of Robots
    • RPA Tools
    • Line Follower Robot
    • What is Blue Prism?
    • RPA vs BPM
  • UiPath
    • What is UiPath
    • UiPath Action Center
    • UiPath?Orchestrator
    • UiPath web automation
    • UiPath Orchestrator API
    • UiPath Delay
    • UiPath Careers
    • UiPath Insights
    • UiPath Split String
    • UiPath Installation
    • UiPath Filter Data Table
    • UiPath Test Suite
    • UiPath Competitors
    • UiPath Architecture
    • UiPath version
    • Uipath Reframework
    • UiPath Studio
  • Interview Questions
    • Deep Learning Interview Questions And Answer
    • Machine Learning Cheat Sheet

Related Courses

Machine Learning Training

Deep Learning Training

Artificial Intelligence Training

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

Special Offer - Machine Learning Training (17 Courses, 27+ Projects) Learn More