mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-11-01 04:54:55 +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
 |