pytorch/pytorch

PyTorch是一个提供强大GPU加速的Python库,具备NumPy类似的张量计算功能,并拥有基于磁带的自动梯度系统,用于构建深度神经网络。它具有动态神经网络构建能力,支持灵活的模型调整。PyTorch包含torch、autograd、nn、multiprocessing等组件,可在CPU和GPU上运行,并提供了便捷的数据加载和处理工具。该框架易于使用,适用于快速实验和大规模研究。此外,PyTorch还提供了安装指南、源代码编译、Docker镜像构建和文档构建等支持。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

PyTorch is a Python package that provides two high-level features:

Tensor computation (like NumPy) with strong GPU acceleration
Deep neural networks built on a tape-based autograd system
You can reuse your favorite Python packages such as NumPy, SciPy, and Cython to extend PyTorch when needed.

More about PyTorch
Installation
Binaries
From Source
Docker Image
Building the Documentation
Previous Versions
Getting Started
Communication
Releases and Contributing
The Team
System 3.6 3.7 3.8
Linux CPU Build Status Build Status —
Linux GPU Build Status Build Status —
Windows CPU / GPU — Build Status —
Linux (ppc64le) CPU — Build Status —
Linux (ppc64le) GPU — Build Status —
Linux (aarch64) CPU Build Status Build Status Build Status
See also the ci.pytorch.org HUD.

More About PyTorch
At a granular level, PyTorch is a library that consists of the following components:

Component Description
torch a Tensor library like NumPy, with strong GPU support
torch.autograd a tape-based automatic differentiation library that supports all differentiable Tensor operations in torch
torch.jit a compilation stack (TorchScript) to create serializable and optimizable models from PyTorch code
torch.nn a neural networks library deeply integrated with autograd designed for maximum flexibility
torch.multiprocessing Python multiprocessing, but with magical memory sharing of torch Tensors across processes. Useful for data loading and Hogwild training
torch.utils DataLoader and other utility functions for convenience
Usually, PyTorch is used either as:

a replacement for NumPy to use the power of GPUs.
a deep learning research platform that provides maximum flexibility and speed.
Elaborating further:

A GPU-Ready Tensor Library
If you use NumPy, then you have used Tensors (a.k.a. ndarray).

Tensor illustration

PyTorch provides Tensors that can live either on the CPU or the GPU and accelerates the computation by a huge amount.

We provide a wide variety of tensor routines to accelerate and fit your scientific computation needs such as slicing, indexing, math operations, linear algebra, reductions. And they are fast!

Dynamic Neural Networks: Tape-Based Autograd
PyTorch has a unique way of building neural networks: using and replaying a tape recorder.

Most frameworks such as TensorFlow, Theano, Caffe, and CNTK have a static view of the world. One has to build a neural network and reuse the same structure again and again. Changing the way the network behaves means that one has to start from scratch.

With PyTorch, we use a technique called reverse-mode auto-differentiation, which allows you to change the way your network behaves arbitrarily with zero lag or overhead. Our inspiration comes from several research papers on this topic, as well as current and past work such as torch-autograd, autograd, Chainer, etc.

While this technique is not unique to PyTorch, it’s one of the fastest implementations of it to date. You get the best of speed and flexibility for your crazy research.

Dynamic graph

Python First
PyTorch is not a Python binding into a monolithic C++ framework. It is built to be deeply integrated into Python. You can use it naturally like you would use NumPy / SciPy / scikit-learn etc. You can write your new neural network layers in

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值