zhiics commented on a change in pull request #7369: URL: https://github.com/apache/tvm/pull/7369#discussion_r566548766
########## File path: src/relay/transforms/memory_alloc.cc ########## @@ -0,0 +1,508 @@ +/* + * 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/transforms/memory_alloc.cc + * \brief A pass for manifesting explicit memory allocations. + */ + +#include <tvm/node/structural_equal.h> +#include <tvm/node/structural_hash.h> +#include <tvm/relay/analysis.h> +#include <tvm/relay/attrs/device_copy.h> +#include <tvm/relay/attrs/memory.h> +#include <tvm/relay/expr.h> +#include <tvm/relay/expr_functor.h> +#include <tvm/relay/op.h> +#include <tvm/relay/transform.h> +#include <tvm/support/logging.h> +#include <tvm/target/target.h> + +#include <cstdint> +#include <cstdio> +#include <string> +#include <unordered_set> +#include <vector> + +#include "../backend/compile_engine.h" +#include "let_list.h" + +using namespace tvm::runtime; + +namespace tvm { +namespace relay { + +extern bool IsDynamic(const Type& ty); +extern Expr ToTupleType(const Type& ty, const std::vector<Expr>& exprs); +extern std::vector<Expr> FromTupleType(const Type& type, const Expr& expr); +extern std::vector<TensorType> FlattenTupleType(const Type& type); Review comment: Thanks for pointing out. I wasn't aware of two. Let's then us pass_utils.h. For the other several ones, I will probably keep them for now. I think we need to have a refactoring to move them out of op/memory. Putting them under pass_util might make more sense. How do you think? ---------------------------------------------------------------- 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]
