Hii, I’m trying to create an Audio Autoencoder using pytorch with 3 layers, the goal is to be something like this: 
But I’m getting this error message:
RuntimeError: Trying to create tensor with negative dimension -1007: [512, 1, 1, -1007]
Here is my model class, I used a yt video as example since I’m very noob with PyTorch. Does anyone know what am I doing wrong? 
class Convautoenc(nn.Module):
    def __init__(self):
        super(Convautoenc, self).__init__()
        self.conv1=nn.Conv1d(in_channels=1, out_channels=16, kernel_size=1024, stride=1, padding=1023, bias=True) #Padding for 'same' filters (kernel_size/2-1)

        self.bn1 =nn.BatchNorm1d(16)
        self.drop=nn.Dropout()
        self.max_pool=nn.MaxPool1d(kernel_size=2,stride=2)
        self.mid1=nn.Linear(12511,16,bias=True)

        self.synconv1=nn.ConvTranspose1d(in_channels=16, out_channels=1, kernel_size=1024, stride=1, padding=1023, bias=True)

    def encoder(self, x):
        #Analysis:
        x = self.conv1(x)  
        y = torch.tanh(x)
        return x

    def middle(self, z):
        z = self.max_pool(z)
        z = self.drop(z)
        z = self.mid1(z)
        z = self.drop(z)
        return z
      
    def decoder(self, y):
        #Synthesis:
        xrek= self.synconv1(y)
        return xrek
      
    def forward(self, x):
        y=self.encoder(x)
        z=self.middle(y)
        #y=torch.round(y/0.125)*0.125
        xrek=self.decoder(z)
        return xrek