junrushao1994 commented on a change in pull request #16351: [IR-Bridge] Support 
attrs for operators: convolution, batch norm, relu
URL: https://github.com/apache/incubator-mxnet/pull/16351#discussion_r332121203
 
 

 ##########
 File path: src/v3/include/ir.h
 ##########
 @@ -0,0 +1,188 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*!
+ * Copyright (c) 2019 by Contributors
+ * \file ir.h
+ * \author Junru Shao
+ */
+#pragma once
+#if MXNET_USE_TVM_OP && !defined MXNET_AMALGAMATION
+// This is a compatibility layer between MNM and Relay
+// We will borrow basically everything from TVM/Relay to here.
+
+#include <tvm/attrs.h>
+#include <tvm/ir.h>
+#include <tvm/runtime/c_runtime_api.h>
+#include <tvm/runtime/packed_func.h>
+#include <tvm/node/container.h>
+#include <tvm/node/memory.h>
+#include <tvm/node/node.h>
+#include <tvm/relay/base.h>
+#include <tvm/relay/expr.h>
+#include <tvm/relay/expr_functor.h>
+#include <tvm/relay/module.h>
+#include <tvm/relay/op.h>
+#include <tvm/relay/op_attr_types.h>
+#include <tvm/relay/type.h>
+
+namespace mxnet {
+namespace v3 {
+namespace ir {
+
+using tvm::Array;
+using tvm::Attrs;
+using tvm::AttrsNode;
+using tvm::Downcast;
+using tvm::GetRef;
+using tvm::Integer;
+using tvm::IntImm;
+using tvm::make_node;
+using tvm::Map;
+using tvm::MapNode;
+using tvm::Node;
+using tvm::NodePtr;
+using tvm::NullValue;
+
+using tvm::relay::DataType;
+using tvm::relay::IndexExpr;
+using tvm::relay::NodeEqual;
+using tvm::relay::NodeHash;
+using tvm::relay::NodeRef;
+
+// Relay Expression
+using tvm::relay::Expr;
+using tvm::relay::ExprNode;
+
+using tvm::relay::FTVMCompute;
+using tvm::relay::FTVMSchedule;
+using tvm::relay::TOpPattern;
+using tvm::relay::Op;
+using tvm::relay::OpNode;
+
+using tvm::relay::Tuple;
+using tvm::relay::TupleNode;
+
+using tvm::relay::Var;
+using tvm::relay::VarNode;
+
+using tvm::relay::GlobalVar;
+using tvm::relay::GlobalVarNode;
+
+using tvm::relay::Function;
+using tvm::relay::FunctionNode;
+
+using tvm::relay::Call;
+using tvm::relay::CallNode;
+
+using tvm::relay::Let;
+using tvm::relay::LetNode;
+
+using tvm::relay::If;
+using tvm::relay::IfNode;
+
+using tvm::relay::TupleGetItem;
+using tvm::relay::TupleGetItemNode;
+
+using tvm::relay::RefCreate;
+using tvm::relay::RefCreateNode;
+
+using tvm::relay::RefRead;
+using tvm::relay::RefReadNode;
+
+using tvm::relay::RefWrite;
+using tvm::relay::RefWriteNode;
+
+using tvm::relay::TempExpr;
+using tvm::relay::TempExprNode;
+
+// Relay Types
+using tvm::relay::Kind;
+
+using tvm::relay::Type;
+using tvm::relay::TypeNode;
+
+using tvm::relay::BaseTensorType;
+using tvm::relay::BaseTensorTypeNode;
+
+using tvm::relay::TensorType;
+using tvm::relay::TensorTypeNode;
+
+using tvm::relay::TypeVar;
+using tvm::relay::TypeVarNode;
+
+using tvm::relay::GlobalTypeVar;
+using tvm::relay::GlobalTypeVarNode;
+
+using tvm::relay::TypeCall;
+using tvm::relay::TypeCallNode;
+
+using tvm::relay::IncompleteType;
+using tvm::relay::IncompleteTypeNode;
+
+using tvm::relay::FuncType;
+using tvm::relay::FuncTypeNode;
+
+using tvm::relay::TupleType;
+using tvm::relay::TupleTypeNode;
+
+using tvm::relay::RefType;
+using tvm::relay::RefTypeNode;
+
+using tvm::relay::TypeConstraint;
+using tvm::relay::TypeConstraintNode;
+
+using tvm::relay::TypeRelation;
+using tvm::relay::TypeRelationNode;
+
+using tvm::relay::TypeReporter;
+
+// Relay Functors
+using tvm::relay::ExprFunctor;
+
+}  // namespace ir
+}  // namespace v3
+}  // namespace mxnet
+
+#define MNM_DEF_NODE_TYPE_INFO(TypeName, Parent) 
TVM_DECLARE_NODE_TYPE_INFO(TypeName, Parent)
 
 Review comment:
   Hmmm good point, I will do another check

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to