Thanks for your reply. I just figured out what happened. I didn’t use docker inside azure. The problem is I mistakenly initialized a nn.embedding in the model with size of 0. (for example nn.Embedding(0,300)).  Then, I will generate this error when  model.share_memory(). Now, I fixed it.