Overview
Both the APIs (V2) in this section and the APIs (V1) in Session can be used to load, compile, and execute graphs. However, the two sets of APIs cannot be used together. It is recommended that the APIs of V2 be used. The APIs of V1 will be phased out gradually.
- The original session contains both GE and DataFlow APIs. Currently, GE-related APIs are grouped as the GeSession class in the ge_api_v2.h header file for clearer module division.
- Besides this, certain optimizations are made to solve the problem that the original APIs use similar names but provide different functions. The original compilation APIs include CompileGraph and BuildGraph, and the original execution APIs include ExecuteGraphWithStreamAsync and RunGraphWithStreamAsync. These APIs have clear distinctions in functions, but their names may be confused and cannot be used together. For example, BuildGraph cannot be used together with ExecuteGraphWithStreamAsync, and CompileGraph cannot be called together with RunGraph/RunGraphAsync.
In V2, APIs are simplified and unified as follows:
- Only one compilation API, that is, CompileGraph, is reserved.
- Only one asynchronous execution API with streams, that is, RunGraphWithStreamAsync, is reserved.
- The inputs and outputs parameters for the execution API use the gert::Tensor type with better performance.
This adjustment aims to improve the clarity and consistency of APIs and prevent function exceptions caused by incorrect API usage.
Parent topic: GESession