隨著深度學習相關領域的熱門,程式碼中的陣列形狀錯誤也越來越 常見,陣列形狀錯誤是一種在進行陣列相關操作時由於形狀不匹配或是 存取了形狀外的位址所造成的錯誤,在Python 中,由於其程式語言的 特性,使的陣列形狀錯誤只能在程式碼執行時才檢查出來。 在本研究中,我們提出一種基於抽象樹分析的靜態分析器,並利用 抽象直譯器的概念僅針對程式碼中的陣列形狀資訊作處理以檢查形狀錯 誤。透過靜態檢查器不只可以更快的發現錯誤並修正而且相比於直接執 行程式碼也能更加節省資源。 在現有研究Pytropos 中對於無法單純由程式碼中得知形狀訊息的外 部資料集使用型別提示(Type Hint) 的方式讓檢查工具獲得足夠的資訊 來協助檢查,而我們提出另一種做法針對CSV 檔可以快速有效的取得外 部資料集形狀資訊,並在錯誤報告中提供詳細的陣列形狀資訊讓使用者 可以更方便的追蹤錯誤以利除錯,我們將此工具命名為ShapeChecker。;With the popularity of deep learning related fields, array shape errors in code are becoming more and more common. Array shape error is an error caused by mismatching shapes or accessing addresses outside the shape during array-related operations. In Python, due to the characteristics of its programming language, the array shape error can only be detected when the code is executed. In this study, we propose a static analyzer based on abstract tree analysis, and use the concept of abstract interpreter to process only the array shape information in the code to check for shape errors. Not only can bugs be found and fixed faster through static checkers, but they can also save more resources than running the code directly. In the existing research Pytropos, the type-hint method is used for external data sets whose shape information cannot be obtained simply from the code, so that the inspection tool can obtain enough information to assist the inspection. And we propose another method to quickly and effectively obtain the shape information of external data sets for CSV files. And provide detailed array shape information in the error report to make it easier for users to track errors for debugging. We named this tool ShapeChecker.