comaniac commented on a change in pull request #6222: URL: https://github.com/apache/incubator-tvm/pull/6222#discussion_r468041057
########## File path: src/relay/backend/contrib/ethosn/codegen.cc ########## @@ -0,0 +1,214 @@ +/* + * 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. + */ + +/*! + * \file src/relay/backend/contrib/ethosn/codegen.cc + * \brief The Relay -> Ethos-N command stream compiler. + */ +#include <tvm/relay/expr_functor.h> +#include <tvm/runtime/module.h> + +#include "codegen_ethosn.h" +#include "ethosn_api.h" + +namespace tvm { +namespace relay { +namespace contrib { +namespace ethosn { + +sl::TensorInfo GetTensorInfo(std::map<Expr, std::vector<sl::TensorInfo>> tensor_table, + const Call& call) { + if (tensor_table.find(call) != tensor_table.end()) return tensor_table[call][0]; + + return sl::TensorInfo(); +} + +void InferTensorsVisitor::InferCall(const CallNode* cn) { Review comment: Make sense to me in the case of more ops will be added to this function in the future, although the flow `Call -> HandleCall` looks a bit weird. Let's keep the current implementation for both functions for now and see if there is a better way after most ops are added. ---------------------------------------------------------------- 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]
