PyTorch文档¶
PyTorch 是一个针对使用GPU和CPU进行深度学习的优化张量库。
本文档中描述的功能按发布状态进行分类:
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 are not, however, committing to backwards compatibility.
Prototype: These features are typically not available as part of binary distributions like PyPI or Conda, except sometimes behind run-time flags, and are at an early stage for feedback and testing.
开发者笔记
语言绑定
Python API
- torch
- torch.nn
- torch.nn.functional
- torch.Tensor
- 张量属性
- 张量视图
- torch.amp
- torch.autograd
- torch.library
- torch.cpu
- torch.cuda
- StreamContext
- torch.cuda.can_device_access_peer
- torch.cuda.current_blas_handle
- torch.cuda.current_device
- torch.cuda.current_stream
- torch.cuda.cudart
- torch.cuda.default_stream
- 设备
- torch.cuda.device_count
- device_of
- torch.cuda.get_arch_list
- torch.cuda.get_device_capability
- torch.cuda.get_device_name
- torch.cuda.get_device_properties
- torch.cuda.get_gencode_flags
- torch.cuda.get_sync_debug_mode
- torch.cuda.init
- torch.cuda.ipc_collect
- torch.cuda.is_available
- torch.cuda.is_initialized
- torch.cuda.memory_usage
- torch.cuda.set_device
- torch.cuda.set_stream
- torch.cuda.set_sync_debug_mode
- torch.cuda.stream
- torch.cuda.synchronize
- torch.cuda.utilization
- torch.cuda.temperature
- torch.cuda.power_draw
- torch.cuda.clock_rate
- torch.cuda.OutOfMemoryError
- 随机数生成器
- 通信集体
- 流和事件
- 图形(测试版)
- 内存管理
- NVIDIA 工具扩展 (NVTX)
- Jiterator(测试版)
- TunableOp
- 流 sanitizer(原型)
- 了解CUDA内存使用情况
- 生成快照
- 使用可视化工具
- 快照 API 参考
- torch.mps
- torch.mps.device_count
- torch.mps.synchronize
- torch.mps.get_rng_state
- torch.mps.set_rng_state
- torch.mps.manual_seed
- torch.mps.seed
- torch.mps.empty_cache
- torch.mps.set_per_process_memory_fraction
- torch.mps.current_allocated_memory
- torch.mps.driver_allocated_memory
- torch.mps.recommended_max_memory
- MPS 分析器
- MPS 事件
- torch.xpu
- StreamContext
- torch.xpu.current_device
- torch.xpu.current_stream
- 设备
- torch.xpu.device_count
- device_of
- torch.xpu.get_device_capability
- torch.xpu.get_device_name
- torch.xpu.get_device_properties
- torch.xpu.init
- torch.xpu.is_available
- torch.xpu.is_initialized
- torch.xpu.set_device
- torch.xpu.set_stream
- torch.xpu.stream
- torch.xpu.synchronize
- 随机数生成器
- 流和事件
- 内存管理
- torch.mtia
- StreamContext
- torch.mtia.current_device
- torch.mtia.current_stream
- torch.mtia.default_stream
- torch.mtia.device_count
- torch.mtia.init
- torch.mtia.is_available
- torch.mtia.is_initialized
- torch.mtia.memory_stats
- torch.mtia.set_device
- torch.mtia.set_stream
- torch.mtia.stream
- torch.mtia.synchronize
- 设备
- torch.mtia.set_rng_state
- torch.mtia.get_rng_state
- torch.mtia.DeferredMtiaCallError
- 流和事件
- 元设备
- torch.backends
- torch.export
- torch.distributed
- torch.distributed.tensor
- torch.distributed.algorithms.join
- torch.distributed.elastic
- torch.distributed.fsdp
- torch.distributed.tensor.parallel
- torch.distributed.optim
- torch.distributed.pipelining
- torch.distributed.checkpoint
save()async_save()save_state_dict()load()load_state_dict()AsyncStagerBlockingAsyncStagerStatefulStorageReaderStorageWriterLoadPlannerLoadPlanReadItemSavePlannerSavePlanWriteItemFileSystemReaderFileSystemWriterDefaultSavePlannerDefaultLoadPlannerget_state_dict()get_model_state_dict()get_optimizer_state_dict()set_state_dict()set_model_state_dict()set_optimizer_state_dict()StateDictOptionsdcp_to_torch_save()torch_save_to_dcp()BroadcastingTorchSaveReaderDynamicMetaLoadPlanner
- torch.distributions
- 评分函数
- 路径导数
- 分布
- ExponentialFamily
- 伯努利
- 测试版
- 二项式
- 分类的
- 柯西
- 中文简体文本:中文简体文本
- ContinuousBernoulli
- 狄利克雷
- 指数的
- FisherSnedecor
- 伽玛
- 几何图形
- 耿贝尔分布
- HalfCauchy
- HalfNormal
- 独立的
- InverseGamma
- 库马拉斯瓦米
- LKJCholesky
- 拉普拉斯
- LogNormal
- LowRankMultivariateNormal
- MixtureSameFamily
- 多项式
- MultivariateNormal
- NegativeBinomial
- 常规
- OneHotCategorical
- 帕累托图
- 泊松分布
- RelaxedBernoulli
- LogitRelaxedBernoulli
- RelaxedOneHotCategorical
- StudentT
- TransformedDistribution
- 统一格式
- VonMises
- 威布尔分布
- 威沙特
- KL Divergence
- Transforms
- Constraints
- Constraint Registry
- torch.compiler
- torch.fft
- torch.func
- torch.futures
- torch.fx
- torch.fx.experimental
- torch.hub
- torch.jit
- torch.linalg
- torch.monitor
- torch.signal
- torch.special
- torch.overrides
- torch.package
- torch.profiler
- torch.nn.init
- torch.nn.attention
- torch.onnx
- torch.optim
- 复数
- DDP通信钩子
- 量化
- 分布式RPC框架
- torch.random
- torch.masked
- torch.nested
- torch.Size
- torch.sparse
- torch.Storage
- torch.testing
- torch.utils
- torch.utils.benchmark
- torch.utils.bottleneck
- torch.utils.checkpoint
- torch.utils.cpp_extension
- torch.utils.data
- torch.utils.deterministic
- torch.utils.jit
- torch.utils.dlpack
- torch.utils.mobile_optimizer
- torch.utils.model_zoo
- torch.utils.tensorboard
- torch.utils.module_tracker
- 类型信息
- 命名张量
- 命名张量运算符覆盖
- torch.__config__
- torch.__future__
- torch._logging
- Torch 环境变量