Thanks for the quick reply.
The optimizer allows to change the encoder because it is configured to What i did was the following:
loss =  encoder_f
loss.backward( retain_graph=True  )
optimizer_enc.step()
Y= autograd.Variable(z,requires_grad=False)
optimizer_dec.zero_grad()
g, _ = decoderl(Y, x)
loss = g
loss.backward()
optimizer_dec.step()
It works, the question if it “torch enough”?
Thanks