• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2021 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 #ifndef MINDSPORE_LITE_INCLUDE_KERNEL_INTERFACE_H_
17 #define MINDSPORE_LITE_INCLUDE_KERNEL_INTERFACE_H_
18 
19 #include <memory>
20 #include <vector>
21 #include "include/api/types.h"
22 #include "include/api/status.h"
23 #include "include/lite_utils.h"
24 #include "schema/model_generated.h"
25 
26 namespace mindspore {
27 namespace kernel {
28 /// \brief KernelInterface defined customized op's interface, such as infershape, and so on.
29 class MS_API KernelInterface {
30  public:
31   /// \brief Destructor of KernelInterface.
32   virtual ~KernelInterface() = default;
33 
34   /// \brief Method to infer customized op's output shape.
35   ///
36   /// \param[in] inputs Define the input tensors of op.
37   /// \param[in] outputs Define the output tensors of op.
38   /// \param[in] primitive Define the attributes of op.
39   ///
40   /// \return  Status as a status identification of inferring.
Infer(std::vector<mindspore::MSTensor> * inputs,std::vector<mindspore::MSTensor> * outputs,const schema::Primitive * primitive)41   virtual Status Infer(std::vector<mindspore::MSTensor> *inputs, std::vector<mindspore::MSTensor> *outputs,
42                        const schema::Primitive *primitive) {
43     return kSuccess;
44   }
45 };
46 }  // namespace kernel
47 }  // namespace mindspore
48 
49 #endif  // MINDSPORE_LITE_INCLUDE_KERNEL_INTERFACE_H_
50