
layout: blog_detail
title: 'PyTorch 0.4.0 Migration Guide'
redirect_from: /2018/04/22/0_4_0-migration-guide.html

Welcome to the migration guide for PyTorch 0.4.0. In this release we introduced many exciting new features and critical bug fixes, with the goal of providing users a better and cleaner interface. In this guide, we will cover the most important changes in migrating existing code from previous versions:

Tensors and Variables have merged
Support for 0-dimensional (scalar) Tensors
Deprecation of the volatile flag
dtypes, devices, and Numpy-style Tensor creation functions
Writing device-agnostic code
New edge-case constraints on names of submodules, parameters, and buffers in nn.Module

Merging Tensor and Variable and classes