cuda_memory.html#using-the-visualizer)
  * [ Snapshot API Reference ](torch_cuda_memory.html#snapshot-api-reference)
  * [ torch.mps ](mps.html)
  * [ torch.xpu ](xpu.html)
  * [ Meta device ](meta.html)
  * [ torch.backends ](backends.html)
  * [ torch.export ](export.html)
  * [ torch.distributed ](distributed.html)
  * [ torch.distributed.algorithms.join ](distributed.algorithms.join.html)
  * [ torch.distributed.elastic ](distributed.elastic.html)
  * [ torch.distributed.fsdp ](fsdp.html)
  * [ torch.distributed.optim ](distributed.optim.html)
  * [ torch.distributed.tensor.parallel ](distributed.tensor.parallel.html)
  * [ torch.distributed.checkpoint ](distributed.checkpoint.html)
  * [ torch.distributions ](distributions.html)
  * [ torch.compiler ](torch.compiler.html)
  * [ torch.fft ](fft.html)
  * [ torch.func ](func.html)
  * [ torch.futures ](futures.html)
  * [ torch.fx ](fx.html)
  * [ torch.fx.experimental ](fx.experimental.html)
  * [ torch.hub ](hub.html)
  * [ torch.jit ](jit.html)
  * [ torch.linalg ](linalg.html)
  * [ torch.monitor ](monitor.html)
  * [ torch.signal ](signal.html)
  * [ torch.special ](special.html)
  * [ torch.overrides ](torch.overrides.html)
  * [ torch.package ](package.html)
  * [ torch.profiler ](profiler.html)
  * [ torch.nn.init ](nn.init.html)
  * [ torch.nn.attention ](nn.attention.html)
  * [ torch.onnx ](onnx.html)
  * [ torch.optim ](optim.html)
  * [ Complex Numbers ](complex_numbers.html)
  * [ DDP Communication Hooks ](ddp_comm_hooks.html)
  * [ Pipeline Parallelism ](pipeline.html)
  * [ Quantization ](quantization.html)
  * [ Distributed RPC Framework ](rpc.html)
  * [ torch.random ](random.html)
  * [ torch.masked ](masked.html)
  * [ torch.nested ](nested.html)
  * [ torch.sparse ](sparse.html)
  * [ torch.Storage ](storage.html)
  * [ torch.testing ](testing.html)
  * [ torch.utils ](utils.html)
  * [ torch.utils.benchmark ](benchmark_utils.html)
  * [ torch.utils.bottleneck ](bottleneck.html)
  * [ torch.utils.checkpoint ](checkpoint.html)
  * [ torch.utils.cpp_extension ](cpp_extension.html)
  * [ torch.utils.data ](data.html)
  * [ torch.utils.deterministic ](deterministic.html)
  * [ torch.utils.jit ](jit_utils.html)
  * [ torch.utils.dlpack ](dlpack.html)
  * [ torch.utils.mobile_optimizer ](mobile_optimizer.html)
  * [ torch.utils.model_zoo ](model_zoo.html)
  * [ torch.utils.tensorboard ](tensorboard.html)
  * [ Type Info ](type_info.html)
  * [ Named Tensors ](named_tensor.html)
  * [ Named Tensors operator coverage ](name_inference.html)
  * [ torch.__config__ ](config_mod.html)
  * [ torch.__future__ ](future_mod.html)
  * [ torch._logging ](logging.html)
  * [ Torch Environment Variables ](torch_environment_variables.html)

Libraries

  * [ torchaudio ](https://pytorch.org/audio/stable)
  * [ TorchData ](https://pytorch.org/data)
  * [ TorchRec ](https://pytorch.org/torchrec)
  * [ TorchServe ](https://pytorch.org/serve)
  * [ torchtext ](https://pytorch.org/text/stable)
  * [ torchvision ](https://pytorch.org/vision/stable)
  * [ PyTorch on XLA Devices ](https://pytorch.org/xla/)

  * Docs  >
  * PyTorch documentation 
  * [ Edit on GitHub ](https://github.com/pytorch/pytorch)

Shortcuts

#  PyTorch documentation  ¶

PyTorch is an optimized tensor library for deep learning using GPUs and CPUs.

Features described in this documentation are classified by release status:

> _Stable:_ These features will be maintained long-term and there should
> generally be no major performance limitations or gaps in documentation. We
> also expect to maintain backwards compatibility (although breaking changes
> can happen and notice will be given one release ahead of time).
>
> _Beta:_ These features are tagged as Beta because the API may change based
> on user feedback, because the performance needs to improve, or because
> coverage across operators is not yet complete. For Beta features, we are
> committing to seeing the feature through to the Stable classification. We
>