Hi, I divide a learned network in submodule. output of  maxpooling module is tuple and I need transform to tensor that to give next one module that have conv2d and relu. what am I doing?
torch.save(model, 'model1.pth')
model1 = torch.load('model1.pth')
#%%

l1 = nn.Sequential(*list(model1.children())[:2]).cuda()
print('l1=',l1)

l2 = nn.Sequential(list(model1.children())[2]).cuda()
print('l2=',l2)

l3 = nn.Sequential(*list(model1.children())[3:5]).cuda()
print('l3=',l3)


l4 = nn.Sequential(*list(model1.children())[5:7]).cuda()
print('l4=',l4)

data1 = next(iter(testloader))

img2,_ = data1
img2[:,:, 45:55, 40:50]=0
 
y1=l1(img2.cuda()).cuda()

y2=l2(y1)

y2 = torch.Tensor(y2)

this part have error:
   y2 = torch.Tensor(y2)

ValueError: only one element tensors can be converted to Python scalars

l1,l2,l3,l4:
l1= Sequential(
  (0): Conv2d(3, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
  (1): ReLU()
)
l2= Sequential(
  (0): MaxPool2d(kernel_size=(2, 2), stride=(2, 2), padding=0, dilation=1, ceil_mode=False)
)
l3= Sequential(
  (0): Conv2d(16, 8, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
  (1): ReLU()
)
l4= Sequential(
  (0): Conv2d(8, 8, kernel_size=(3, 3), stride=(1, 1))
  (1): ReLU()
)