• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020-2023 Huawei Technologies Co., Ltd
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MINDSPORE_LITE_SRC_RUNTIME_INFER_MANAGER_H_
18 #define MINDSPORE_LITE_SRC_RUNTIME_INFER_MANAGER_H_
19 
20 #include <map>
21 #include <vector>
22 #include <set>
23 #include <string>
24 #include <memory>
25 #include "src/common/prim_util.h"
26 #include "src/tensor.h"
27 #include "nnacl/tensor_c.h"
28 #include "nnacl/infer/infer.h"
29 #include "include/api/kernel.h"
30 #include "include/api/allocator.h"
31 
32 namespace mindspore::lite {
33 MS_API int KernelInferShape(const std::vector<lite::Tensor *> &tensors_in, const std::vector<lite::Tensor *> &outputs,
34                             OpParameter *parameter, std::shared_ptr<Allocator> allocator = nullptr);
35 MS_API int KernelInferShape(const std::vector<lite::Tensor *> &inputs, const std::vector<lite::Tensor *> &outputs,
36                             const void *primitive, std::set<std::string> &&providers, int schema_version,
37                             const kernel::Kernel *kernel = nullptr);
38 typedef bool (*InferChecker)(const std::vector<Tensor *> &, const std::vector<Tensor *> &);
39 bool InferCheckerAll(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
40 bool InferCheckerInput(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
41 bool InferCheckerOutput(const std::vector<Tensor *> &inputs, const std::vector<Tensor *> &outputs);
42 }  // namespace mindspore::lite
43 
44 #endif  // MINDSPORE_LITE_SRC_RUNTIME_INFER_MANAGER_H_
45