diff --git a/mindspore/ccsrc/backend/kernel_compiler/cpu/quantum/quantum_simulator/transformer.cc b/mindspore/ccsrc/backend/kernel_compiler/cpu/quantum/quantum_simulator/transformer.cc index 44b2b1790a..76419d9e3e 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/cpu/quantum/quantum_simulator/transformer.cc +++ b/mindspore/ccsrc/backend/kernel_compiler/cpu/quantum/quantum_simulator/transformer.cc @@ -109,7 +109,6 @@ Hamiltonians HamiltoniansTransfor(const PaulisCoeffsType &paulis_coeffs, const P } return hams; } - } // namespace transformer } // namespace mindquantum } // namespace mindspore diff --git a/mindspore/core/abstract/prim_arrays.cc b/mindspore/core/abstract/prim_arrays.cc index d5937dbe89..3b476268fc 100644 --- a/mindspore/core/abstract/prim_arrays.cc +++ b/mindspore/core/abstract/prim_arrays.cc @@ -1056,7 +1056,6 @@ AbstractBasePtr InferImplRange(const AnalysisEnginePtr &, const PrimitivePtr &pr TypePtr range_start_type = CheckTensorDType(range_start, supported_types, "range_start input of Range should be %s"); TypePtr range_end_type = CheckTensorDType(range_end, supported_types, "range_start input of Range should be %s"); TypePtr range_delta_type = CheckTensorDType(range_delta, supported_types, "range_start input of Range should be %s"); - // check all 3 inputs are same type if (!IsIdentidityOrSubclass(range_start_type, range_end_type) || !IsIdentidityOrSubclass(range_end_type, range_delta_type)) { diff --git a/mindspore/core/ir/value.cc b/mindspore/core/ir/value.cc index 0f589fedbe..47e204a476 100644 --- a/mindspore/core/ir/value.cc +++ b/mindspore/core/ir/value.cc @@ -309,5 +309,4 @@ const ValuePtr kUMonad = std::make_shared(); bool IOMonad::operator==(const Value &other) const { return other.isa(); } const ValuePtr kIOMonad = std::make_shared(); - } // namespace mindspore diff --git a/mindspore/core/ops/audio_spectrogram.cc b/mindspore/core/ops/audio_spectrogram.cc index 46ded529d2..b0f5d8c6ff 100644 --- a/mindspore/core/ops/audio_spectrogram.cc +++ b/mindspore/core/ops/audio_spectrogram.cc @@ -94,12 +94,12 @@ int64_t AudioSpectrogram::Log2Ceil(int64_t length) { floor += shift; } } - return length == (length & ~(length - 1)) ? floor : floor + 1; + return length == (length & ~(unsigned int)(length - 1)) ? floor : floor + 1; } int64_t AudioSpectrogram::GetFftLength(int64_t length) { int64_t shift = Log2Ceil(length); - return 1 << shift; + return 1 << (unsigned int)shift; } void AudioSpectrogram::set_mag_square(const bool mag_square) { this->AddAttr(kMagSquare, MakeValue(mag_square)); } diff --git a/mindspore/core/ops/batch_norm_fold.cc b/mindspore/core/ops/batch_norm_fold.cc index dd48bfe72a..097e85f947 100644 --- a/mindspore/core/ops/batch_norm_fold.cc +++ b/mindspore/core/ops/batch_norm_fold.cc @@ -22,7 +22,6 @@ namespace mindspore { namespace ops { - void BatchNormFold::Init(const float momentum, const float epsilon, const bool is_training, const int64_t freeze_bn) { set_momentum(momentum); set_epsilon(epsilon); diff --git a/mindspore/core/ops/broadcast_to.h b/mindspore/core/ops/broadcast_to.h index e6baf7ce51..bb678a1f39 100644 --- a/mindspore/core/ops/broadcast_to.h +++ b/mindspore/core/ops/broadcast_to.h @@ -41,7 +41,6 @@ class BroadcastTo : public PrimitiveC { AbstractBasePtr BroadcastToInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args); using PrimBroadcastToPtr = std::shared_ptr; - } // namespace ops } // namespace mindspore diff --git a/mindspore/core/ops/ceil.cc b/mindspore/core/ops/ceil.cc index 7a786a3ae2..e9262b7698 100644 --- a/mindspore/core/ops/ceil.cc +++ b/mindspore/core/ops/ceil.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { - AbstractBasePtr CeilInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args) { for (const auto &item : input_args) { diff --git a/mindspore/core/ops/concat.cc b/mindspore/core/ops/concat.cc index ba6906a839..6c9c65d58a 100644 --- a/mindspore/core/ops/concat.cc +++ b/mindspore/core/ops/concat.cc @@ -21,7 +21,6 @@ #include "utils/check_convert_utils.h" namespace mindspore { namespace ops { - void Concat::Init(const int64_t axis) { this->set_axis(axis); } int64_t Concat::get_axis() const { auto value_ptr = this->GetAttr(kAxis); diff --git a/mindspore/core/ops/fusion/adder_fusion.h b/mindspore/core/ops/fusion/adder_fusion.h index 5d5ec8ff34..491b3d8cbe 100644 --- a/mindspore/core/ops/fusion/adder_fusion.h +++ b/mindspore/core/ops/fusion/adder_fusion.h @@ -31,6 +31,7 @@ constexpr auto kNameAdderFusion = "AdderFusion"; class AdderFusion : public Adder { public: AdderFusion() : Adder(kNameAdderFusion) {} + ~AdderFusion() = default; MS_DECLARE_PARENT(AdderFusion, Adder); void Init(const int64_t in_channel, const int64_t out_channel, const std::vector &kernel_size, const PadMode &pad_mode, const std::vector &stride, const std::vector &pad_list, diff --git a/mindspore/core/ops/fusion/avg_pool_fusion.cc b/mindspore/core/ops/fusion/avg_pool_fusion.cc index b0c053e96d..6013bbfcf0 100644 --- a/mindspore/core/ops/fusion/avg_pool_fusion.cc +++ b/mindspore/core/ops/fusion/avg_pool_fusion.cc @@ -18,7 +18,6 @@ namespace mindspore { namespace ops { - void AvgPoolFusion::Init(const std::vector &kernel_size, const std::vector &stride, const PadMode &pad_mode, const Format &format, const std::vector &pad, const RoundMode &round_mode, const bool global, const ActivationType activation_type) { diff --git a/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h b/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h index a2e175d979..8227b52093 100644 --- a/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h +++ b/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h @@ -27,6 +27,7 @@ constexpr auto kNameConv2DBackpropInputFusion = "Conv2DBackpropInputFusion"; class Conv2DBackpropInputFusion : public Conv2DBackpropInput { public: Conv2DBackpropInputFusion() : Conv2DBackpropInput(kNameConv2DBackpropInputFusion) {} + ~Conv2DBackpropInputFusion() = default; MS_DECLARE_PARENT(Conv2DBackpropInputFusion, Conv2DBackpropInput); void Init(int64_t in_channel, int64_t out_channel, const std::vector &kernel_size, int64_t mode = 1, const PadMode &pad_mode = VALID, const std::vector &pad = {0, 0, 0, 0}, diff --git a/mindspore/core/ops/fusion/conv2d_fusion.h b/mindspore/core/ops/fusion/conv2d_fusion.h index 1a267e967e..e5b44ea6d7 100644 --- a/mindspore/core/ops/fusion/conv2d_fusion.h +++ b/mindspore/core/ops/fusion/conv2d_fusion.h @@ -28,6 +28,7 @@ constexpr auto kNameConv2DFusion = "Conv2DFusion"; class Conv2DFusion : public Conv2D { public: Conv2DFusion() : Conv2D(kNameConv2DFusion) {} + ~Conv2DFusion() = default; MS_DECLARE_PARENT(Conv2DFusion, Conv2D); void Init(int64_t in_channel, int64_t out_channel, const std::vector &kernel_size, int64_t mode = 1, const PadMode &pad_mode = VALID, const std::vector &pad = {0, 0, 0, 0}, diff --git a/mindspore/core/ops/fusion/div_fusion.h b/mindspore/core/ops/fusion/div_fusion.h index dec9dde7d6..0b2e410f09 100644 --- a/mindspore/core/ops/fusion/div_fusion.h +++ b/mindspore/core/ops/fusion/div_fusion.h @@ -26,6 +26,7 @@ constexpr auto kNameDivFusion = "DivFusion"; class DivFusion : public Div { public: DivFusion() : Div(kNameDivFusion) {} + ~DivFusion() = default; MS_DECLARE_PARENT(DivFusion, Div); void Init(const ActivationType &activation_type = NO_ACTIVATION); void set_activation_type(const ActivationType &activation_type); diff --git a/mindspore/core/ops/fusion/l2_normalize_fusion.h b/mindspore/core/ops/fusion/l2_normalize_fusion.h index 56dea08c94..f2d7f16281 100644 --- a/mindspore/core/ops/fusion/l2_normalize_fusion.h +++ b/mindspore/core/ops/fusion/l2_normalize_fusion.h @@ -28,6 +28,7 @@ constexpr auto kNameL2NormalizeFusion = "L2NormalizeFusion"; class L2NormalizeFusion : public L2Normalize { public: L2NormalizeFusion() : L2Normalize(kNameL2NormalizeFusion) {} + ~L2NormalizeFusion() = default; MS_DECLARE_PARENT(L2NormalizeFusion, L2Normalize); void Init(const std::vector &axis, const float epsilon = 1e-4, const ActivationType &activation_type = NO_ACTIVATION); diff --git a/mindspore/core/ops/fusion/reduce_fusion.cc b/mindspore/core/ops/fusion/reduce_fusion.cc index e88f2d568c..ec0b99702f 100644 --- a/mindspore/core/ops/fusion/reduce_fusion.cc +++ b/mindspore/core/ops/fusion/reduce_fusion.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { - void ReduceFusion::set_keep_dims(const bool keep_dims) { this->AddAttr(kKeepDims, MakeValue(keep_dims)); } void ReduceFusion::set_mode(const ReduceMode mode) { diff --git a/mindspore/core/ops/fusion/scale_fusion.h b/mindspore/core/ops/fusion/scale_fusion.h index bc2d664b54..599a6b6781 100644 --- a/mindspore/core/ops/fusion/scale_fusion.h +++ b/mindspore/core/ops/fusion/scale_fusion.h @@ -26,6 +26,7 @@ constexpr auto kNameScaleFusion = "ScaleFusion"; class ScaleFusion : public Scale { public: ScaleFusion() : Scale(kNameScaleFusion) {} + ~ScaleFusion() = default; MS_DECLARE_PARENT(ScaleFusion, Scale); void Init(const int64_t axis = -1, const ActivationType &activation_type = NO_ACTIVATION); void set_activation_type(const ActivationType &activation_type); diff --git a/mindspore/core/ops/fusion/sub_fusion.h b/mindspore/core/ops/fusion/sub_fusion.h index 46df3204b1..3b9ecfe993 100644 --- a/mindspore/core/ops/fusion/sub_fusion.h +++ b/mindspore/core/ops/fusion/sub_fusion.h @@ -26,6 +26,7 @@ constexpr auto kNameSubFusion = "SubFusion"; class SubFusion : public Sub { public: SubFusion() : Sub(kNameSubFusion) {} + ~SubFusion() = default; MS_DECLARE_PARENT(SubFusion, Sub); void Init(const ActivationType &activation_type = NO_ACTIVATION); void set_activation_type(const ActivationType &activation_type); diff --git a/mindspore/core/ops/fusion/tile_fusion.h b/mindspore/core/ops/fusion/tile_fusion.h index 357cc94e11..ff8459ec8f 100644 --- a/mindspore/core/ops/fusion/tile_fusion.h +++ b/mindspore/core/ops/fusion/tile_fusion.h @@ -28,6 +28,7 @@ constexpr auto kNameTileFusion = "TileFusion"; class TileFusion : public Tile { public: TileFusion() : Tile(kNameTileFusion) {} + ~TileFusion() = default; MS_DECLARE_PARENT(TileFusion, Tile); void Init(const std::vector &dims); void set_dims(const std::vector &dims); diff --git a/mindspore/core/ops/fusion/topk_fusion.h b/mindspore/core/ops/fusion/topk_fusion.h index c9a80c1966..168c927f5d 100644 --- a/mindspore/core/ops/fusion/topk_fusion.h +++ b/mindspore/core/ops/fusion/topk_fusion.h @@ -28,6 +28,7 @@ constexpr auto kNameTopKFusion = "TopKFusion"; class TopKFusion : public TopK { public: TopKFusion() : TopK(kNameTopKFusion) {} + ~TopKFusion() = default; MS_DECLARE_PARENT(TopKFusion, TopK); void Init(const bool sorted, const int64_t axis, const int64_t largest); void set_axis(const int64_t axis); diff --git a/mindspore/core/ops/grad/activation_grad.cc b/mindspore/core/ops/grad/activation_grad.cc index 09df3fd2b5..afc2638b1d 100644 --- a/mindspore/core/ops/grad/activation_grad.cc +++ b/mindspore/core/ops/grad/activation_grad.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { - void ActivationGrad::Init(const ActivationType &type, const float alpha) { this->set_activation_type(type); this->set_alpha(alpha); diff --git a/mindspore/core/ops/grad/avg_pool_grad.h b/mindspore/core/ops/grad/avg_pool_grad.h index c0e4c90001..c6a41e0f6a 100644 --- a/mindspore/core/ops/grad/avg_pool_grad.h +++ b/mindspore/core/ops/grad/avg_pool_grad.h @@ -38,7 +38,6 @@ class AvgPoolGrad : public PoolGrad { AbstractBasePtr AvgPoolGradInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args); using PrimAvgPoolGradPtr = std::shared_ptr; - } // namespace ops } // namespace mindspore diff --git a/mindspore/core/ops/grad/power_grad.cc b/mindspore/core/ops/grad/power_grad.cc index 62c635d626..97fdfbaa86 100644 --- a/mindspore/core/ops/grad/power_grad.cc +++ b/mindspore/core/ops/grad/power_grad.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { - void PowerGrad::set_power(const float power) { this->AddAttr(kPower, MakeValue(power)); } float PowerGrad::get_power() const { auto value_ptr = GetAttr(kPower); diff --git a/mindspore/core/ops/hashtable_lookup.cc b/mindspore/core/ops/hashtable_lookup.cc index c7496d1305..d3e16efc98 100644 --- a/mindspore/core/ops/hashtable_lookup.cc +++ b/mindspore/core/ops/hashtable_lookup.cc @@ -21,7 +21,6 @@ namespace mindspore { namespace ops { - AbstractBasePtr HashtableLookupInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args) { MS_EXCEPTION_IF_NULL(primitive); diff --git a/mindspore/core/ops/lstm.cc b/mindspore/core/ops/lstm.cc index 8c51b3cde2..a42abf1be5 100644 --- a/mindspore/core/ops/lstm.cc +++ b/mindspore/core/ops/lstm.cc @@ -57,8 +57,8 @@ AbstractBasePtr LstmInfer(const PrimitivePtr &primitive, const std::vector &input_args) { MS_EXCEPTION_IF_NULL(primitive); diff --git a/mindspore/core/ops/non_max_suppression.cc b/mindspore/core/ops/non_max_suppression.cc index 195523d5ff..501adcb224 100644 --- a/mindspore/core/ops/non_max_suppression.cc +++ b/mindspore/core/ops/non_max_suppression.cc @@ -20,7 +20,6 @@ namespace mindspore { namespace ops { - void NonMaxSuppression::set_center_point_box(const int64_t center_point_box) { AddAttr(kCenterPointBox, MakeValue(center_point_box)); } diff --git a/mindspore/core/ops/permute.cc b/mindspore/core/ops/permute.cc index 911b7e8ef1..773fcf05ea 100644 --- a/mindspore/core/ops/permute.cc +++ b/mindspore/core/ops/permute.cc @@ -25,7 +25,6 @@ namespace mindspore { namespace ops { - void Permute::set_order(const std::vector &order) { this->AddAttr(kOrder, MakeValue(order)); } std::vector Permute::get_order() const { diff --git a/mindspore/core/ops/primitive_c.cc b/mindspore/core/ops/primitive_c.cc index 067a0a3bee..94d2c5f23b 100644 --- a/mindspore/core/ops/primitive_c.cc +++ b/mindspore/core/ops/primitive_c.cc @@ -43,6 +43,5 @@ OpPrimCRegister &OpPrimCRegister::GetInstance() { std::map OpPrimCRegister::GetPrimCMap() { return op_primc_fns_; } void OpPrimCRegister::SetPrimCMap(const std::string &kname, const OpPrimCDefineFunc &fn) { op_primc_fns_[kname] = fn; } - } // namespace ops } // namespace mindspore diff --git a/mindspore/core/ops/proposal.h b/mindspore/core/ops/proposal.h index 24c7b0727b..462bd2fb67 100644 --- a/mindspore/core/ops/proposal.h +++ b/mindspore/core/ops/proposal.h @@ -51,7 +51,6 @@ class Proposal : public PrimitiveC { int64_t get_post_nms_topn() const; float get_nms_thresh() const; }; - } // namespace ops } // namespace mindspore diff --git a/mindspore/core/ops/range.cc b/mindspore/core/ops/range.cc index 7e866d8d28..f28951d61e 100644 --- a/mindspore/core/ops/range.cc +++ b/mindspore/core/ops/range.cc @@ -65,7 +65,7 @@ AbstractBasePtr RangeInfer(const abstract::AnalysisEnginePtr &, const PrimitiveP MS_EXCEPTION_IF_NULL(primitive); auto prim = primitive->cast(); MS_EXCEPTION_IF_NULL(prim); - int64_t shape_size; + int64_t shape_size = 0; TypeId dtype; if (input_args.size() == 3) { MS_EXCEPTION_IF_NULL(input_args[0]->BuildValue()); diff --git a/mindspore/core/ops/reduce.cc b/mindspore/core/ops/reduce.cc index 0114473032..cad04f92e9 100644 --- a/mindspore/core/ops/reduce.cc +++ b/mindspore/core/ops/reduce.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { namespace { - void reduce_one_axis(const int64_t one_axis, const int64_t dim, std::set axis_reduce) { CheckAndConvertUtils::CheckInRange("axis", one_axis, kIncludeLeft, {-dim, dim}, "Reduce"); if (one_axis < 0) { diff --git a/mindspore/core/ops/reduce_all.cc b/mindspore/core/ops/reduce_all.cc index 8f55e26f74..43b252c1ec 100644 --- a/mindspore/core/ops/reduce_all.cc +++ b/mindspore/core/ops/reduce_all.cc @@ -25,7 +25,6 @@ namespace mindspore { namespace ops { - REGISTER_PRIMITIVE_C(kNameReduceAll, ReduceAll); } // namespace ops } // namespace mindspore diff --git a/mindspore/core/ops/resize_bilinear.cc b/mindspore/core/ops/resize_bilinear.cc index 0ed4cacf06..4d9969ce64 100644 --- a/mindspore/core/ops/resize_bilinear.cc +++ b/mindspore/core/ops/resize_bilinear.cc @@ -25,7 +25,6 @@ namespace mindspore { namespace ops { - void ResizeBilinear::set_size(const std::vector &size) { this->AddAttr(kSize, MakeValue(size)); } std::vector ResizeBilinear::get_size() const { diff --git a/mindspore/core/ops/softmax_cross_entropy_with_logits.cc b/mindspore/core/ops/softmax_cross_entropy_with_logits.cc index ff636678b4..3a05576720 100644 --- a/mindspore/core/ops/softmax_cross_entropy_with_logits.cc +++ b/mindspore/core/ops/softmax_cross_entropy_with_logits.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { - AbstractBasePtr SoftmaxCrossEntropyWithLogitsInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args) { MS_EXCEPTION_IF_NULL(primitive); diff --git a/mindspore/core/ops/space_to_batch_nd.cc b/mindspore/core/ops/space_to_batch_nd.cc index c66d118ce7..4117c15d4a 100644 --- a/mindspore/core/ops/space_to_batch_nd.cc +++ b/mindspore/core/ops/space_to_batch_nd.cc @@ -35,7 +35,7 @@ abstract::ShapePtr InferShape(const PrimitivePtr &primitive, const std::vectorget_block_shape(); auto padding = space_prim->get_paddings(); int64_t size = block_shape.size(); diff --git a/mindspore/core/ops/to_format.cc b/mindspore/core/ops/to_format.cc index 39628ccf1a..78f4ac51ab 100644 --- a/mindspore/core/ops/to_format.cc +++ b/mindspore/core/ops/to_format.cc @@ -26,7 +26,6 @@ namespace mindspore { namespace ops { - void ToFormat::set_src_t(const int64_t src_t) { this->AddAttr(kSrcT, MakeValue(src_t)); } int64_t ToFormat::get_src_t() const { auto value_ptr = GetAttr(kSrcT); diff --git a/mindspore/core/ops/unpack.cc b/mindspore/core/ops/unpack.cc index c105f7f7d0..76db999095 100644 --- a/mindspore/core/ops/unpack.cc +++ b/mindspore/core/ops/unpack.cc @@ -18,7 +18,6 @@ namespace mindspore { namespace ops { - void Unpack::Init(const int64_t axis) { this->set_axis(axis); } void Unpack::set_axis(const int64_t axis) { AddAttr(kAxis, MakeValue(axis)); } int64_t Unpack::get_axis() const { diff --git a/mindspore/core/ops/where.cc b/mindspore/core/ops/where.cc index 2c79b5cc43..f583d5751a 100644 --- a/mindspore/core/ops/where.cc +++ b/mindspore/core/ops/where.cc @@ -22,7 +22,6 @@ namespace mindspore { namespace ops { - AbstractBasePtr WhereInfer(const abstract::AnalysisEnginePtr &, const PrimitivePtr &primitive, const std::vector &input_args) { MS_EXCEPTION_IF_NULL(primitive);