目录

torch.mps

This package enables an interface for accessing MPS backend in python

synchronize

Waits for all kernels in all streams on a MPS device to complete.

get_rng_state

Returns the random number generator state as a ByteTensor.

set_rng_state

Sets the random number generator state.

manual_seed

Sets the seed for generating random numbers.

seed

Sets the seed for generating random numbers to a random number.

empty_cache

Releases all unoccupied cached memory currently held by the caching allocator so that those can be used in other GPU applications.

set_per_process_memory_fraction

Set memory fraction for limiting process's memory allocation on MPS device.

current_allocated_memory

Returns the current GPU memory occupied by tensors in bytes.

driver_allocated_memory

Returns total GPU memory allocated by Metal driver for the process in bytes.

文档

访问 PyTorch 的全面开发人员文档

查看文档

教程

获取面向初学者和高级开发人员的深入教程

查看教程

资源

查找开发资源并解答您的问题

查看资源