You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/09/30 16:31:33 UTC

[GitHub] [tvm] Mousius commented on a change in pull request #9163: [CMSIS-NN] Initial operator support for Mul

Mousius commented on a change in pull request #9163:
URL: https://github.com/apache/tvm/pull/9163#discussion_r719575615



##########
File path: src/relay/backend/contrib/cmsisnn/relay_to_tir.cc
##########
@@ -32,17 +32,37 @@ namespace relay {
 namespace contrib {
 namespace cmsisnn {
 
-class RelayToTIR : public MixedModeVisitor {
+class RelayToTIRVisitor : public MixedModeVisitor {
  public:
-  explicit RelayToTIR(String func_name) : func_name_(func_name) {}
+  explicit RelayToTIRVisitor(String func_name) : func_name_(func_name) {}
+
+  tir::PrimFunc GetReplacementPrimFunc() { return primfunc_; }
 
  private:
-  void emit_softmax_tir(const Expr& expr) {
+  template <typename T>
+  const T ArgumentToConstantValue(const Expr& arg) {
+    const ConstantNode* constant_node = arg.as<ConstantNode>();
+    return static_cast<const T*>(constant_node->data->data)[0];
+  }
+
+  void CreatePrimFuncForExtern(Array<tir::Var> func_signature,

Review comment:
       We should check when we get there whether we can keep it generic or if we want to split this into `CreateCallExtern` and `CreatePrimFunc` with a `body`. :thinking: 




-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org