feat: 直接支持改边

Signed-off-by: YdrMaster <ydrml@hotmail.com>
This commit is contained in:
YdrMaster 2023-09-19 17:46:35 +08:00
parent 7bdaea97ba
commit 6cd08abad9
2 changed files with 4 additions and 3 deletions

@ -1 +1 @@
Subproject commit b26483a39c1d4813a52718d6c9f793e4f1e349a7
Subproject commit 520f88d812136092735acc410dd399f5141b5be4

View File

@ -34,8 +34,9 @@ class Handler {
explicit Handler(Graph g) : _g(std::move(g)) {}
std::unordered_set<Name> fillEdgeInfo() { return _g.fillEdgeInfo(); }
void setInput(size_t index, std::shared_ptr<Tensor> tensor) {
ASSERT(_g.setInput(index, std::move(tensor)),
fmt::format("set input {} failed with wrong shape", index));
ASSERT(index < _g.internal().topology.globalInputsCount(),
fmt::format("set input {} failed with wrong index", index));
_g.internal().edges[index].tensor = std::move(tensor);
}
void substitute(const char *name, int64_t value) {
ASSERT(_g.substitute(name, value),