Lunderberg commented on code in PR #16596: URL: https://github.com/apache/tvm/pull/16596#discussion_r1499478152
########## src/relax/transform/reorder_permute_dims_after_concat.cc: ########## @@ -0,0 +1,173 @@ +/* + * 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 tvm/relax/transform/reorder_permute_dims_after_concat.cc + * \brief Reorder concat(permute_dims(A), permute_dims(B)) into permute_dims(concat(A,B)) + */ + +#include <tvm/relax/analysis.h> +#include <tvm/relax/dataflow_matcher.h> +#include <tvm/relax/expr.h> +#include <tvm/relax/expr_functor.h> +#include <tvm/relax/transform.h> + +#include <optional> +#include <unordered_set> +#include <vector> + +#include "../op/tensor/index.h" +#include "../op/tensor/linear_algebra.h" +#include "../op/tensor/manipulate.h" + +namespace tvm { +namespace relax { + +namespace { +std::tuple<DFPattern, TypedPackedFunc<Expr(Expr, Map<DFPattern, Expr>)>> CreatePatterns() { + // TODO(Lunderberg): Allow pattern-matching to handle a flexible + // number of arguments, each of which matches the same type of + // pattern. + size_t min_concat = 2; + size_t max_concat = 12; Review Comment: For now, I've added a comment indicating why the value is not being exposed, and with a recommendation to increase `max_concat` if required, at least until pattern matching of arbitrary tuple sizes is supported. -- 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]
