• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2022 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_CORE_OPS_DYNAMIC_GRU_V2_GRAD_H_
18 #define MINDSPORE_CORE_OPS_DYNAMIC_GRU_V2_GRAD_H_
19 #include <memory>
20 #include <vector>
21 
22 #include "abstract/abstract_value.h"
23 #include "mindapi/base/types.h"
24 #include "ops/base_operator.h"
25 #include "utils/check_convert_utils.h"
26 
27 namespace mindspore {
28 namespace ops {
29 constexpr auto kNameDynamicGRUV2Grad = "DynamicGRUV2Grad";
30 class MIND_API DynamicGRUV2Grad : public BaseOperator {
31  public:
32   MIND_API_BASE_MEMBER(DynamicGRUV2Grad);
33 
34   /// \brief Constructor.
DynamicGRUV2Grad()35   DynamicGRUV2Grad() : BaseOperator(kNameDynamicGRUV2Grad) {
36     InitIOName({"x", "weight_input", "weight_hidden", "y", "init_h", "h", "dy", "dh", "update", "reset", "new",
37                 "hidden_new", "seq_length", "mask"},
38                {"dw_input", "dw_hidden", "db_input", "db_hidden", "dx", "dh_prev"});
39   }
40 };
41 AbstractBasePtr DynamicGRUV2GradInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive,
42                                       const std::vector<AbstractBasePtr> &input_args);
43 
44 using PrimDynamicGRUV2GradPtr = std::shared_ptr<DynamicGRUV2Grad>;
45 }  // namespace ops
46 }  // namespace mindspore
47 #endif  // MINDSPORE_CORE_OPS_DYNAMIC_GRU_V2_GRAD_H_
48