1 | /* |
2 | * Licensed to the Apache Software Foundation (ASF) under one |
3 | * or more contributor license agreements. See the NOTICE file |
4 | * distributed with this work for additional information |
5 | * regarding copyright ownership. The ASF licenses this file |
6 | * to you under the Apache License, Version 2.0 (the |
7 | * "License"); you may not use this file except in compliance |
8 | * with the License. You may obtain a copy of the License at |
9 | * |
10 | * http://www.apache.org/licenses/LICENSE-2.0 |
11 | * |
12 | * Unless required by applicable law or agreed to in writing, |
13 | * software distributed under the License is distributed on an |
14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
15 | * KIND, either express or implied. See the License for the |
16 | * specific language governing permissions and limitations |
17 | * under the License. |
18 | */ |
19 | |
20 | /*! |
21 | * \file const_loader_module.h |
22 | * \brief Defines an interface to use the ConstLoaderModule. |
23 | */ |
24 | |
25 | #ifndef TVM_RUNTIME_CONST_LOADER_MODULE_H_ |
26 | #define TVM_RUNTIME_CONST_LOADER_MODULE_H_ |
27 | |
28 | #include <tvm/runtime/ndarray.h> |
29 | |
30 | #include <string> |
31 | #include <unordered_map> |
32 | #include <vector> |
33 | |
34 | namespace tvm { |
35 | namespace runtime { |
36 | |
37 | /*! |
38 | * \brief Create a ConstLoader module object. |
39 | * |
40 | * \param const_var_ndarray Maps consts var name to NDArray containing data for the var. |
41 | * \param const_vars_by_symbol Maps the name of a module init function to a list of names of |
42 | * const vars whose data will be passed to that init function. |
43 | * |
44 | * \return The created ConstLoaderModule. |
45 | */ |
46 | Module ConstLoaderModuleCreate( |
47 | const std::unordered_map<std::string, NDArray>& const_var_ndarray, |
48 | const std::unordered_map<std::string, std::vector<std::string>>& const_vars_by_symbol); |
49 | |
50 | } // namespace runtime |
51 | } // namespace tvm |
52 | |
53 | #endif // TVM_RUNTIME_CONST_LOADER_MODULE_H_ |
54 | |