something like this:
prior = Linear(...)
dec = Linear(...)
def myfunc(xi):
   z_prior = prior(h)
   z = xi * z_prior[:,compressed_size:].exp() + z_prior[:, :compressed_size]
   return dec(torch.cat(h, z))

xi -  this x1,x2,x3. In this moment they can be replaced by Variable(torch.randn(…)) and this function will be without any parameters.