Obtaining spatially resolved tumor purity maps using deep multiple instance learning in a pan-cancer study