Learning dynamic and hierarchical traffic spatiotemporal features with Transformer