From: @liangzhibo Reviewed-by: @kingxian,@jpc_chenjianping Signed-off-by: @kingxiantags/v1.2.0-rc1
| @@ -67,7 +67,7 @@ void Conv2dTranspose::Init(int64_t in_channel, int64_t out_channel, const std::v | |||||
| } | } | ||||
| void Conv2dTranspose::set_in_channel(int64_t in_channel) { | void Conv2dTranspose::set_in_channel(int64_t in_channel) { | ||||
| AddAttr(kOutChannel, MakeValue(CheckAndConvertUtils::CheckInteger(kInChannel, in_channel, kGreaterThan, 0, name()))); | |||||
| AddAttr(kInChannel, MakeValue(CheckAndConvertUtils::CheckInteger(kInChannel, in_channel, kGreaterThan, 0, name()))); | |||||
| } | } | ||||
| void Conv2dTranspose::set_out_channel(int64_t out_channel) { | void Conv2dTranspose::set_out_channel(int64_t out_channel) { | ||||
| @@ -0,0 +1,24 @@ | |||||
| /** | |||||
| * Copyright 2020 Huawei Technologies Co., Ltd | |||||
| * | |||||
| * Licensed 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. | |||||
| */ | |||||
| #include "ops/is_finite.h" | |||||
| #include "ops/op_utils.h" | |||||
| namespace mindspore { | |||||
| namespace ops { | |||||
| REGISTER_PRIMITIVE_C(kNameIsFinite, IsFinite); | |||||
| } // namespace ops | |||||
| } // namespace mindspore | |||||
| @@ -0,0 +1,37 @@ | |||||
| /** | |||||
| * Copyright 2020 Huawei Technologies Co., Ltd | |||||
| * | |||||
| * Licensed 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. | |||||
| */ | |||||
| #ifndef MINDSPORE_CORE_OPS_IS_FINITE_H_ | |||||
| #define MINDSPORE_CORE_OPS_IS_FINITE_H_ | |||||
| #include "ops/primitive_c.h" | |||||
| #include "abstract/abstract_value.h" | |||||
| #include "utils/check_convert_utils.h" | |||||
| namespace mindspore { | |||||
| namespace ops { | |||||
| constexpr auto kNameIsFinite = "IsFinite"; | |||||
| class IsFinite : public PrimitiveC { | |||||
| public: | |||||
| IsFinite() : PrimitiveC(kNameIsFinite) {} | |||||
| ~IsFinite() = default; | |||||
| MS_DECLARE_PARENT(IsFinite, PrimitiveC); | |||||
| void Init() {} | |||||
| }; | |||||
| } // namespace ops | |||||
| } // namespace mindspore | |||||
| #endif // MINDSPORE_CORE_OPS_IS_FINITE_H_ | |||||
| @@ -303,16 +303,6 @@ std::vector<int64_t> CheckAndConvertUtils::CheckPositiveVector(const std::string | |||||
| raise_message(); | raise_message(); | ||||
| } | } | ||||
| } | } | ||||
| // if (arg_value.size() == 1) { | |||||
| // return ret_four ? std::vector<int64_t>{1, 1, arg_value[0], arg_value[0]} | |||||
| // : std::vector<int64_t>{arg_value[0], arg_value[0]}; | |||||
| // } | |||||
| // if (arg_value.size() == 2) { | |||||
| // return ret_four ? std::vector<int64_t>{1, 1, arg_value[0], arg_value[1]} : arg_value; | |||||
| // } else if (arg_value.size() == 4 && allow_four) { | |||||
| // return ret_four ? arg_value : std::vector<int64_t>{arg_value[2], arg_value[3]}; | |||||
| // } | |||||
| // raise_message(); | |||||
| return arg_value; | return arg_value; | ||||
| } | } | ||||