Pytorch Install

Dependencies and steps through which Pytorch gets installed on your development machine.

Intro

As of Dec 2019, the instructions to install Pytorch are here instructions and one options is to run:

$  pip install torch torchvision

To learn more about pip see the pip note.

Wheels for torch

For python 3.7 Pytorch is provided through 2 files, one per operating system:

  • torch-1.3.1-cp37-cp37m-manylinux1_x86_64.whl
  • torch-1.3.1-cp37-none-macosx_10_7_x86_64.whl

As opposed to TF there is no support wheel for windows. Also TF uses the newer manylinux2010 platform tag.

File summary

This is a summary of the files in the macos wheel.

Ext Files Largest file Size [kB]
.py 881 torch/_torch_docs.py 222.09
.dylib 9 torch/lib/libtorch.dylib 191035.35
.so 3 caffe2/python/caffe2_pybind11_state.cpython-37m-darwin.so 2094.53
.pyi 46 torch/__init__.pyi 113.13
.h 1092 torch/include/ATen/Functions.h 960.79
.cuh 6 torch/include/ATen/cuda/CUDAApplyUtils.cuh 49.27
.hpp 5 torch/include/TH/THTensor.hpp 5.01
.cmake 29 torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA.cmake 86.06

Outside dependencies

As opposed to TF, Pytorch only has one external dependency.

  • numpy

Also CUDA support is provided in the base install.