PyTorch 文件¶
PyTorch 是一個針對使用 GPU 和 CPU 進行深度學習而優化的張量函式庫。
本文件中描述的功能按發佈狀態分類
穩定:這些功能將長期維護,並且通常應該沒有重大的效能限制或文件缺失。我們也期望維持向後相容性(儘管可能會發生重大變更,並且會提前一個版本發出通知)。
測試版:這些功能被標記為測試版,因為 API 可能會根據使用者回饋而變更,因為效能需要改進,或者因為運算子的涵蓋範圍尚未完成。對於測試版功能,我們承諾會將該功能推廣到穩定分類。但是,我們不承諾向後相容性。
原型:這些功能通常不作為二進制發行版(如 PyPI 或 Conda)的一部分提供,除非有時在執行時旗標後面,並且處於回饋和測試的早期階段。
開發人員注意事項
語言繫結
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.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
- Stream Sanitizer(原型)
 
- 瞭解 CUDA 記憶體使用量
- 產生快照
- 使用視覺化器
- 快照 API 參考
- torch.mps
- torch.xpu- StreamContext
- torch.xpu.current_device
- torch.xpu.current_stream
- 裝置
- torch.xpu.device_count
- device_of
- torch.xpu.empty_cache
- 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
- 元裝置
- torch.backends
- torch.export
- torch.distributed
- torch.distributed.algorithms.join
- torch.distributed.elastic
- torch.distributed.fsdp
- torch.distributed.optim
- torch.distributed.pipelining
- torch.distributed.tensor.parallel
- torch.distributed.checkpoint- save()
- async_save()
- save_state_dict()
- load()
- load_state_dict()
- AsyncStager
- BlockingAsyncStager
- Stateful
- StorageReader
- StorageWriter
- LoadPlanner
- LoadPlan
- ReadItem
- SavePlanner
- SavePlan
- WriteItem
- FileSystemReader
- FileSystemWriter
- DefaultSavePlanner
- DefaultLoadPlanner
- get_state_dict()
- get_model_state_dict()
- get_optimizer_state_dict()
- set_state_dict()
- set_model_state_dict()
- set_optimizer_state_dict()
- StateDictOptions
- dcp_to_torch_save()
- torch_save_to_dcp()
- BroadcastingTorchSaveReader
- DynamicMetaLoadPlanner
 
- torch.distributions
- 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 環境變數