I have made few changes now I am having CUDA Memory allocation error
class netG(nn.Module):
  def __init__(self,nChannels=256,channel_rate=64,drop_rate=0.0,dilation=1):
    super(netG, self).__init__()
    self.channel_rate = channel_rate
    self.nChannels = 4*self.channel_rate
    self.drop_rate = drop_rate
    self.dilation = 1
    self.head = nn.Conv2d(3,4*self.channel_rate,3,1,1)
  
  def dense_block(self,x):
    bn1 = nn.BatchNorm2d(self.nChannels),
    act = nn.LeakyReLU(0.2), 
    conv1 = nn.Conv2d(self.nChannels,4*self.channel_rate,1,1),
    bn2 = nn.BatchNorm2d(4*self.channel_rate),
    conv2 = nn.Conv2d(4*self.channel_rate,self.channel_rate,3,1,self.dilation,self.dilation),
    bn3 = nn.BatchNorm2d(self.channel_rate),
    dropout = nn.Dropout2d(self.drop_rate)
    def forward(x):
      x = bn1(x)
      x = act(x)
      x = conv1(x)
      x = bn2(x)
      x = conv2(x)
      x = bn3(x)
      x = dropout(x)
    return x

  def tail(self,x):
    bn1 = nn.BatchNorm2d(self.nChannels)
    act = nn.LeakyReLU(0.2)
    conv1 = nn.Conv2d(self.nChannels,4*self.channel_rate,1,1)
    bn2 = nn.BatchNorm2d(4*self.channel_rate)
    dropout = nn.Dropout(self.drop_rate)
    def forward(x):
      x = bn1(x)
      x = act(x)
      x = conv1(x)
      x = bn2(x)
      x = dropout(x)
    return x
    
  def last_layer(self,x):
    conv1 = nn.Conv2d(self.nChannels,self.channel_rate,3,1,1),
    act = nn.PReLU(),
    conv2 = nn.Conv2d(self.channel_rate,3,3,1,1),
    act1 = nn.Tanh()
    def forward(x):
      x = conv1(x)
      x = act(x)
      x = conv2(x)
      x = act1(x)
    return x
    

  def forward(self,x):
    x = self.head(x)
    x1 = x

    self.nChannels = x.size(1)
    self.dilation = 1
    d1 = self.dense_block(x)
    x = torch.cat((x,d1),1)
    
    self.nChannels = x.size(1)
    self.dilation = 1
    d2 = self.dense_block(x)
    x = torch.cat((x,d2),1)
    
    self.nChannels = x.size(1)
    self.dilation = 2
    d3 = self.dense_block(x)
    x = torch.cat((x,d3),1)
   
    self.nChannels = x.size(1)
    self.dilation = 1
    d4 = self.dense_block(x)
    x = torch.cat((x,d4),1)
    
    self.nChannels = x.size(1)
    self.dilation = 3
    d5 = self.dense_block(x)
    x = torch.cat((x,d5),1)
    
    self.nChannels = x.size(1)
    self.dilation = 3
    d6 = self.dense_block(x)
    x = torch.cat((x,d6),1)
    
    self.nChannels = x.size(1)
    self.dilation = 1
    d7 = self.dense_block(x)
    x = torch.cat((x,d7),1)
    
    self.nChannels = x.size(1)
    self.dilation = 2
    d8 = self.dense_block(x)
    x = torch.cat((x,d8),1)

    self.nChannels = x.size(1)
    self.dilation = 1
    d9 = self.dense_block(x)
    x = torch.cat((x,d9),1)
    
    self.nChannels = x.size(1)
    self.dilation = 1
    d10 = self.dense_block(x)

    self.nChannels = x.size(1)
    x = self.tail(d10)

    x = torch.cat((x,x1),1)

    self.nChannels = x.size(1)
    x = last_layer(x)

    return x

     88     self.dilation = 3
     89     d6 = self.dense_block(x)
---> 90     x = torch.cat((x,d6),1)
     91 
     92     self.nChannels = x.size(1)

RuntimeError: CUDA out of memory. Tried to allocate 12.00 GiB (GPU 0; 15.90 GiB total capacity; 11.82 GiB already allocated; 3.24 GiB free; 11.85 GiB reserved in total by PyTorch)