Amortized Variational Inference: When and Why?