In Python, you can control what is the operator swap in and out interfaces

What is the Python interface in PyTorch that controls the memory copy and release of operators?