Introduction
Overview
You can use the open Ascend Graph APIs to construct offline models to implement offline inference on the Ascend AI Processor in either of the following ways:
- Construct a graph from operator prototypes and build it into an offline model. In this way, you can build graphs on Caffe, TensorFlow, or more other frameworks.
- Parse a source model into a graph and build it into an offline model. In this way, you can only build graphs on Caffe or TensorFlow.
Graph Structure
TensorFlow and ONNX define networks in similar formats. A network model consists of tensors, nodes (or operators), and a graph.
- A tensor involves the tensor description and tensor data. Tensor description describes the name, dtype, shape, and format of the tensor.
- An operator involves its name, type, input, and attributes.
- A graph consists of the network name, operator list, and input and output operators.
Model Construction Flow
Figure 1-1 shows the graph construction and build flow using Ascend Graph API.