gpu_cache = ["cache-a", "cache-b"] cpu_cache = [] # Cache C needs GPU space, so cache A moves to CPU memory. cpu_cache.append(gpu_cache.pop(0)) gpu_cache.append("cache-c") print("GPU after cache C arrives:", gpu_cache) print("CPU after cache C arrives:", cpu_cache) # Cache A is needed again, so it returns to the GPU. cpu_cache.remove("cache-a") cpu_cache.append(gpu_cache.pop(0)) gpu_cache.append("cache-a") print("GPU after cache A returns:", gpu_cache) print("CPU after cache A returns:", cpu_cache) # Output: """ GPU after cache C arrives: ['cache-b', 'cache-c'] CPU after cache C arrives: ['cache-a'] GPU after cache A returns: ['cache-c', 'cache-a'] CPU after cache A returns: ['cache-b'] """