Hi everyone

I have a kind of funny question

Who knows that how can I save (store) output of a layer ?

Codes below represents my NN. Basically I would like to save last layer of my encoder to a tensor

#Autoencoder and Autodecoder conv layerâ€¦

class Autoencoder(nn.Module):

def **init**(self):

super(Autoencoder,self).**init**()

```
self.encoder = nn.Sequential(
nn.Conv1d(1,3,kernel_size=4, stride=2),
nn.MaxPool1d(3, stride=2),
nn.Tanh(),
nn.Conv1d(3,6,kernel_size=4, stride = 2),
nn.MaxPool1d(3,stride=1),
nn.Tanh(),
nn.Conv1d(6,9,kernel_size=3, stride=1),
nn.MaxPool1d(2,stride = 1),
nn.Tanh(),
nn.Conv1d(9,12,kernel_size = 3, stride = 1),
nn.MaxPool1d(2,stride = 1),
nn.Tanh())
self.decoder = nn.Sequential(
nn.ConvTranspose1d(12,9,kernel_size = 3, stride = 2),
nn.Tanh(),
nn.ConvTranspose1d(9,6,kernel_size = 4,stride = 1),
nn.Tanh(),
nn.ConvTranspose1d(6,3,kernel_size= 8,stride = 2),
nn.Tanh(),
nn.ConvTranspose1d(3,1,kernel_size = 8, stride = 4),
nn.Tanh())
```

def forward(self,x):

x = self.encoder(x)

x = self.decoder(x)

return x

Thanks all