The traffic assignment problem (TAP) has been a well-known research problem in transportation science for over five decades. Various solution algorithms, including link-based, path-based, and bush-based methods, have been developed to address this problem, with different structural complexities, memory requirements, and solution efficiency. In transportation planning practice, it is required to execute a traffic assignment algorithm hundreds or thousands of times to find the most efficient planning scenarios for a large metropolitan network, which may be very time-consuming, often taking several days and even a few weeks. In this study, we suggest a data-driven method to perform evaluating a large number of transportation planning scenarios in a quicker manner. Instead of relying on iterative network optimization-oriented or equilibrium-oriented algorithms, we introduce a graph attention network (GAT) within an encoder-decoder framework to learn and derive traffic assignment solutions. The model consists of an encoder module and a decoder module, where the encoder module utilizes a special attention mechanism to abstract complex spatial supply-demand features, and the decoder module transforms these features into network flow patterns. We also present two model variants based on different output objectives: one directly predicts link flows, while the other first predicts path flows and then converts them to link flows. To validate the proposed models with different structural configurations and parameter values, we conducted two rounds of experiments on a set of widely used benchmark networks with various topological structures and demand patterns. The results show that both models can predict link flow rates with a mean absolute percentage error ranging from 3.8% to 8.5% across different networks. Moreover, they require lower computing time compared to traditional convergence algorithms. As the network size increases, the computational efficiency advantage becomes more pronounced. This suggests that the proposed machine learning approach provides an efficient computing procedure for executing traffic assignment for a large number of transportation planning scenarios.