A structure-aware framework for learning device placements on computation graphs