I am trying to implement a model that projects a vector to a fixed lower dimension and then after passing it through an LSTM and some other layers, performs the inverse with the same Linear layer.
To be more precise, we perform the following operations:
y = W * x (as a Linear layer)
...
(perform some processing on x to get k)
...
output = W' * k (how to do this with a Linear layer?)

As you can see, the first and last operation use the same layer weights. Can anyone let me know what is the correct way to do this in PyTorch?