Shortcuts

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.

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources