Thank you ptrblck . I figured if my ultimate goal is to split the AE, then the best thing is build two different NNs for encoder and decoder, and then combine them in a third one for training purpose.