d-smirnov commented on a change in pull request #8509:
URL: https://github.com/apache/tvm/pull/8509#discussion_r803693903
##########
File path: src/ir/module.cc
##########
@@ -219,6 +224,64 @@ void IRModuleNode::AddUnchecked(const GlobalVar& var,
const BaseFunc& func) {
global_var_map_.Set(var->name_hint, var);
}
+// Replaces constant data to index into mod's "Constants" attrs array.
+// Only processes tir::PrimFunc and ignores everything else
+void IRModuleNode::ExtractConstants(BaseFunc f) {
+ using ConstArrayType = Array<runtime::NDArray>;
+ class Applicator : public tir::StmtExprVisitor {
+ protected:
+ // returns index of the a in constant_array_, if not found - appends
+ // TODO(@d-smirnov): make real content comparision with already existing
NDArrays
Review comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]