The "throw" statement is not allowed in mindspore project (codedex check),
so we remove the self-define exception and replace with MS_LOG(EXCEPTION).
In GraphKernelExpanders, we check the return value instead.
The rollback function in ArithmeticSimplify / TrnasformOpOptimizer
is not supported now.
what's more,
changed the c++ op expanders from .h files to .cc files,
the OpExpanderRegister is called in each .cc file, likes
the operator registers in mindspore.
modifications for pass transform_op_optimizer:
1. Changed the maxflow-mincut algorithm to the Dinic's Algorithm,
since bug exists in the original ISAP codes.
if the algorithm is slow, we can apply some optimization for it. (e.g. current-arc optimization)
2. Added the pass TransformOpOptimizer in OptLevel_3.
this pass collects nodes around the specific transform operator (only Transpose now),
and use the mincut algorithm to get a plan, then re-link the original graph and
re-inference the shape and format of graph.
modifications for litegraph:
1. the class Node inherits from std::enable_shared_from_this,so we can get a shared_ptr by a pure pointer.
2. modified the Infer interface. it don't change the node, only inference the infos and return them.
This reverts commit b077aa1cab.
Revert "[feat] [assistant] [I3T96X] add new Dataset operator LibriSpeechDataset"
This reverts commit 4e6f7dc97d.
delete pass_registry_test.cc
comment hiai_nlu_model_multi.pb related line
transplant the op expander code from python to c++, base on LiteGraph.
the c++ expander will be called in priority if it was registered in OpExpanderFactory.
add two examples, BiasAdd and ExpandDims.
remove BiasAdd from python expanders.
since the ExpandDims is also imported by other ops (e.g. BatchNorm), we don't remove it now.
For convenience, we may change some operators' shape in equivalent way,
such as changing the scalar value (shape is empty) to a tensor with shape [1].
It's ok for the intermediate tensors, but not for the outputs.
So we save the output shapes in pre-process stage, and restore them in post-process stage.
Add a subdirectory "model" in the "backend/optimizer/graph_kernel" for litegraph.
Implement two interfaces "AnfGraph2LiteGraph" and "LiteGraph2AnfGraph".
The litegraph will be the base data structure when we migrate the GraphKernel code
from python("mindspore/_extends/graph_kernel") to c++.