Microstructural heterogeneity and dynamic shear localization