Thanks @Nikronic, it worked that way. I am struck with another problem. I have created the optimizer and passed the parameters. Suppose in some training step I want to freeze one of the nets and only want to update weights of the others. Is that possible?