mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Better support device agnostic, add a "cpu" return for `current_device()` in torch.cpu so that we won't run into `AttributeError: module 'torch.cpu' has no attribute 'current_device'`. Pull Request resolved: https://github.com/pytorch/pytorch/pull/110987 Approved by: https://github.com/wanchaol
26 lines
406 B
ReStructuredText
26 lines
406 B
ReStructuredText
torch.cpu
|
|
===================================
|
|
.. automodule:: torch.cpu
|
|
.. currentmodule:: torch.cpu
|
|
|
|
.. autosummary::
|
|
:toctree: generated
|
|
:nosignatures:
|
|
|
|
current_device
|
|
current_stream
|
|
is_available
|
|
synchronize
|
|
stream
|
|
set_device
|
|
device_count
|
|
StreamContext
|
|
|
|
Streams and events
|
|
------------------
|
|
.. autosummary::
|
|
:toctree: generated
|
|
:nosignatures:
|
|
|
|
Stream
|