Merging DataType, Backend, ForwardDims into Compile()
Handling DataType, Backend and Tensor's dimensions and format is messy. Each caracterisitc may depend on another.
- Cannot run ForwardDims if necessary Transpose Operators have not been set
- Cannot run ForwardDims if uncompatible data formats
- Cannot handle format if backend is not known
- ...
Solution
Rather than leaving the user run each of these functions in an undefined order, it would be best to have a single function to do them in the right order without thinking further. Its goal would be to "set the GraphView ready for execution".
Here is how it would work:
- Transform the GraphView to manage Backend:
- insert Transmittors Operators between two Nodes not running on the same backend
- Transform the GraphView to manage DataType:
- insert Transpose Operators between two Nodes not using the same format
- insert TypeConversion Operators between two Nodes not using the same DataType
- Deduce dimensions