PyTorch 文档¶
PyTorch 是一个优化的张量库,用于使用 GPU 和 CPU 进行深度学习。
本文档中描述的功能按版本状态分类:
稳定:这些功能将长期维护,通常应该有 在文档中没有重大的性能限制或差距。 我们还希望保持向后兼容性(尽管 可能会发生重大更改,并且将提前一个版本发出通知 的时间)。
试用版:这些功能被标记为 Beta 版,因为 API 可能会根据 用户反馈,因为性能需要改进,或者因为 跨 Operators 的覆盖范围尚未完成。对于 Beta 版功能,我们是 致力于将该功能一直持续到 Stable 分类。 但是,我们并不承诺向后兼容。
原型:这些功能通常不作为 PyPI 或 Conda 等二进制发行版,但有时落后于运行时 标志,并且处于反馈和测试的早期阶段。
- 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.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(测试版)
- Stream Sanitizer(原型)
- 了解 CUDA 内存使用情况
- 生成快照
- 使用可视化工具
- 快照 API 参考
- torch.mps
- torch.backends
- torch.export
- torch.distributed
- torch.distributed.algorithms.join
- torch.distributed.elastic
- torch.distributed.fsdp
- torch.distributed.optim
- torch.distributed.tensor.parallel
parallelize_module()
行向平行
ColwiseParallel
PairwiseParallel (配对平行)
SequenceParallel (序列并行)
make_input_replicate_1d()
make_input_reshard_replicate()
make_input_shard_1d()
make_input_shard_1d_last_dim()
make_output_replicate_1d()
make_output_reshard_tensor()
make_output_shard_1d()
make_output_tensor()
enable_2d_with_fsdp()
pre_dp_module_transform()
- torch.distributed.checkpoint
- torch.distributions
- Score 函数
- Pathwise 导数
- 分配
- 指数系列
- 伯努利
- 试用版
- 二项式
- 分类
- 柯 西
- 气2
- 连续式伯努利
- 狄里克莱
- 指数
- 费舍尔斯内德科
- 伽马
- 几何
- 甘贝
- 半柯西
- 半法线
- 独立
- 库马拉斯瓦米
- LKJCholesky
- 拉普拉斯
- 对数
- LowRankMultivariateNormal
- MixtureSameFamily
- 多项式
- MultivariateNormal
- 负双项式
- 正常
- OneHotCategorical 餐厅
- 帕 累 托
- 泊 松
- 松弛伯努利
- LogitRelaxedBernoulli
- RelaxedOneHotCategorical
- 学生T
- TransformedDistribution
- 均匀
- 冯米塞斯
- 威布尔
- 威沙特
- KL Divergence
- 变换
- 约束
- 约束注册表
- torch.compiler
- torch.fft
- torch.func
- torch.futures
- torch.fx
- torch.hub
- torch.jit
- torch.linalg
- torch.monitor
- torch.signal
- torch.special
- torch.overrides
- torch.package
- torch.profiler
- torch.nn.init
- torch.onnx
- torch.optim
- 复数
- DDP 通信钩子
- 管道并行度
- 量化
- 分布式 RPC 框架
- torch.random
- torch.masked
- torch.nested
- 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.jit
- torch.utils.dlpack
- torch.utils.mobile_optimizer
- torch.utils.model_zoo
- torch.utils.tensorboard
- 类型信息
- 命名张量
- 命名张量算子覆盖率
- torch.__config__
- torch._logging