It is true that the non-releasable memory can be reallocated to the new tensor, but when the new tensor is large, the non-releasable memory can not be combined with the released memory to obtain a whole block of memory to hold the new tensor. When the available video memory is 14GB (colab), the following two examples show this situation:
import torch
from torch import nn
from torch.nn import functional as F
from torch import cuda  

def test(inp): 
  w = torch.rand([32, 1, 1, 1],device='cuda') 
  a = F.conv2d(inp, w)*5 # 
  y = F.conv_transpose2d(a, w) # 
  return y
 
outp = test(torch.zeros([128,1,512,512],device='cuda'))  
cuda.empty_cache()
print(cuda.memory_summary())  

a = torch.zeros(11,256,1024,1024,device='cuda')  
print(cuda.memory_summary())  

import torch
from torch import nn
from torch.nn import functional as F
from torch import cuda  

def test(inp): 
  w = torch.rand([32, 1, 1, 1],device='cuda') 
  a = F.conv2d(inp, w) #Only modified here
  y = F.conv_transpose2d(a*5, w) #Only modified here
  return y
 
outp = test(torch.zeros([128,1,512,512],device='cuda'))  
cuda.empty_cache()
print(cuda.memory_summary())  

a = torch.zeros(11,256,1024,1024,device='cuda')  
print(cuda.memory_summary())  

How to solve this problem?