Even with 1 batch_size (1 sample) error is there.
   85     self.dilation = 3
     86     d6 = self.dense_block(x)
---> 87     x = torch.cat((x,d6),1)
     88 
     89     self.nChannels = x.size(1)

RuntimeError: CUDA out of memory. Tried to allocate 4.00 GiB (GPU 0; 7.43 GiB total capacity; 3.94 GiB already allocated; 2.86 GiB free; 3.94 GiB reserved in total by PyTorch)