Yes it’s possible, though I am confused about where the concatenation happens in the encoder as the parameters of Linear seem to be incorrect : should be nn.Linear(256+8,z_dim*2) if you concatenate with previous View. Try to make a first working model with initialization and forward, and I will help.