thanks for your help, I could to transform a by size of [8,8,3,3], but I can not in phase test after changing one layer, to giving data for changed model and taking the images in output of test phase. please guide me…
my code:
def test(model,test_loader):

    with torch.no_grad():
     for data in test_loader:
      output = model(data)
      return output 
      
for k in range(0, max_epochs, 9):
        plt.figure(figsize=(9, 2))
        imgs = output[k][0].detach().numpy()
        recon = output[k][0].detach().numpy()
        for i, item in enumerate(imgs):
         if i >= 9: break
         plt.subplot(2, 9, i+1)
         plt.imshow(item[0])
        
        for i, item in enumerate(recon):
         if i >= 9: break
         plt.subplot(2, 9, 9+i+1)
         plt.imshow(item[0])  


error of this section is:
TypeError                                 Traceback (most recent call last)
<ipython-input-34-6393568d6986> in <module>()
     20          if i >= 9: break
     21          plt.subplot(2, 9, i+1)
---> 22          plt.imshow(item[0])
     23 
     24         for i, item in enumerate(recon):

5 frames
/usr/local/lib/python3.7/dist-packages/matplotlib/image.py in set_data(self, A)
    697                 or self._A.ndim == 3 and self._A.shape[-1] in [3, 4]):
    698             raise TypeError("Invalid shape {} for image data"
--> 699                             .format(self._A.shape))
    700 
    701         if self._A.ndim == 3:

TypeError: Invalid shape () for image data