# tensorplay.cuda.set_per_process_memory_fraction Source: https://www.tensorplay.cn/docs/generated/tensorplay.cuda.set_per_process_memory_fraction.html ```python tensorplay.cuda.set_per_process_memory_fraction(fraction, device: Any = None) → None ``` Set memory fraction for a process. Not enforced by this TensorPlay build; the signature is retained for API compatibility. Parameters: - fraction ([float](https://docs.python.org/3/builtins/functions.html#float)) – Range: 0~1. Allowed memory equals total_memory * fraction. - device ([tensorplay.Device](/docs/generated/tensorplay.Device.html#tensorplay.Device) or [int](https://docs.python.org/3/builtins/functions.html#int), optional) – selected device.