First, graph inputs and their names:
- Makes it clear what inputs graph has
- Indirectly demands for type specification e.g. Stream<AnyType> a = graph.In(0); vs Stream<int> a = graph.In(0).Cast<int>();
Then graph nodes
- Nodes are added and used as they needed
- One node is not mixed in other nodes, only its outputs
- Indirectly demands for type specification e.g. Stream<AnyType> a = node.Out(0); vs Stream<int> a = node.Out(0).Cast<int>();
Then graph outputs
- Makes it clear what outputs graph has
The recommended structure keep C++ graph similar to pbtxt representation.
PiperOrigin-RevId: 504701023