From 077f10b7b629960d28dc1e534bf8fb89cffa26d9 Mon Sep 17 00:00:00 2001 From: liutongtong Date: Fri, 13 Aug 2021 18:40:19 +0800 Subject: [PATCH] =?UTF-8?q?code=20check=20for=20master=0D=0D#=20Conflicts:?= =?UTF-8?q?=0D#=09mindspore/common/initializer.py=0D#=09mindspore/nn/cell.?= =?UTF-8?q?py=0D#=0D#=20=E4=BC=BC=E4=B9=8E=E6=82=A8=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?=E5=81=9A=E4=B8=80=E4=B8=AA=E6=8B=A3=E9=80=89=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E3=80=82=E5=A6=82=E6=9E=9C=E4=B8=8D=E5=AF=B9=EF=BC=8C=E8=AF=B7?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=0D#=09.git/CHERRY=5FPICK?= =?UTF-8?q?=5FHEAD=0D#=20=E7=84=B6=E5=90=8E=E9=87=8D=E8=AF=95=E3=80=82=0D?= =?UTF-8?q?=0D=0D#=20=E8=AF=B7=E4=B8=BA=E6=82=A8=E7=9A=84=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E8=BE=93=E5=85=A5=E6=8F=90=E4=BA=A4=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E3=80=82=E4=BB=A5=20'#'=20=E5=BC=80=E5=A7=8B=E7=9A=84=E8=A1=8C?= =?UTF-8?q?=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5=EF=BC=8C=E8=80=8C=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=0D#=20=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E4=BC=9A=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E3=80=82=0D#=0D#=20=E6=97=A5=E6=9C=9F=EF=BC=9A=20=20Fri=20Aug?= =?UTF-8?q?=2013=2018:40:19=202021=20+0800=0D#=0D#=20=E4=BD=8D=E4=BA=8E?= =?UTF-8?q?=E5=88=86=E6=94=AF=20code=5Freview=5Fr1.3=0D#=20=E6=82=A8?= =?UTF-8?q?=E7=9A=84=E5=88=86=E6=94=AF=E4=B8=8E=E4=B8=8A=E6=B8=B8=E5=88=86?= =?UTF-8?q?=E6=94=AF=20'ma/r1.3'=20=E4=B8=80=E8=87=B4=E3=80=82=0D#=0D#=20?= =?UTF-8?q?=E6=82=A8=E5=9C=A8=E6=89=A7=E8=A1=8C=E6=8B=A3=E9=80=89=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=20ffda6be35c=20=E7=9A=84=E6=93=8D=E4=BD=9C=E3=80=82?= =?UTF-8?q?=0D#=0D#=20=E8=A6=81=E6=8F=90=E4=BA=A4=E7=9A=84=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=EF=BC=9A=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20mindspore/common/=5F=5Finit=5F=5F.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/=5Fregister?= =?UTF-8?q?=5Ffor=5Ftensor.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20mindspore/common/api.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=20=20=20=20=20mindspore/common/dtype.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/initializer.p?= =?UTF-8?q?y=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/com?= =?UTF-8?q?mon/monad.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mi?= =?UTF-8?q?ndspore/common/parameter.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=20=20=20=20=20mindspore/common/seed.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/tensor.py=0D#?= =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn/cell.?= =?UTF-8?q?py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn?= =?UTF-8?q?/metrics/=5F=5Finit=5F=5F.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=20=20=20=20=20mindspore/nn/metrics/confusion=5Fmatrix.py=0D#?= =?UTF-8?q?=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn/metri?= =?UTF-8?q?cs/error.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20min?= =?UTF-8?q?dspore/nn/metrics/fbeta.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20?= =?UTF-8?q?=20=20=20=20mindspore/nn/metrics/loss.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn/metrics/metric.py?= =?UTF-8?q?=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn/m?= =?UTF-8?q?etrics/precision.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20mindspore/nn/metrics/recall.py=0D#=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20mindspore/nn/metrics/topk.py=0D#=09?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/train/callb?= =?UTF-8?q?ack/=5Fcheckpoint.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20mindspore/train/model.py=0D#=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20mindspore/train/serialization.py=0D#=0D?= =?UTF-8?q?=0D#=20Conflicts:=0D#=09mindspore/common/api.py=0D#=09mindspore?= =?UTF-8?q?/common/initializer.py=0D#=09mindspore/nn/metrics/confusion=5Fm?= =?UTF-8?q?atrix.py=0D#=0D#=20=E4=BC=BC=E4=B9=8E=E6=82=A8=E6=AD=A3?= =?UTF-8?q?=E5=9C=A8=E5=81=9A=E4=B8=80=E4=B8=AA=E6=8B=A3=E9=80=89=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E3=80=82=E5=A6=82=E6=9E=9C=E4=B8=8D=E5=AF=B9=EF=BC=8C?= =?UTF-8?q?=E8=AF=B7=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=0D#=09.git/CHERRY?= =?UTF-8?q?=5FPICK=5FHEAD=0D#=20=E7=84=B6=E5=90=8E=E9=87=8D=E8=AF=95?= =?UTF-8?q?=E3=80=82=0D=0D=0D#=20=E8=AF=B7=E4=B8=BA=E6=82=A8=E7=9A=84?= =?UTF-8?q?=E5=8F=98=E6=9B=B4=E8=BE=93=E5=85=A5=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E3=80=82=E4=BB=A5=20'#'=20=E5=BC=80=E5=A7=8B=E7=9A=84?= =?UTF-8?q?=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5=EF=BC=8C=E8=80=8C?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=0D#=20?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E5=B0=86=E4=BC=9A=E7=BB=88=E6=AD=A2=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E3=80=82=0D#=0D#=20=E6=97=A5=E6=9C=9F=EF=BC=9A=20=20F?= =?UTF-8?q?ri=20Aug=2013=2018:40:19=202021=20+0800=0D#=0D#=20=E4=BD=8D?= =?UTF-8?q?=E4=BA=8E=E5=88=86=E6=94=AF=20code=5Freview=5Fmaster=0D#=20?= =?UTF-8?q?=E6=82=A8=E7=9A=84=E5=88=86=E6=94=AF=E4=B8=8E=E4=B8=8A=E6=B8=B8?= =?UTF-8?q?=E5=88=86=E6=94=AF=20'ma/master'=20=E4=B8=80=E8=87=B4=E3=80=82?= =?UTF-8?q?=0D#=0D#=20=E6=82=A8=E5=9C=A8=E6=89=A7=E8=A1=8C=E6=8B=A3?= =?UTF-8?q?=E9=80=89=E6=8F=90=E4=BA=A4=20743f9fbff3=20=E7=9A=84=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E3=80=82=0D#=0D#=20=E8=A6=81=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=9A=84=E5=8F=98=E6=9B=B4=EF=BC=9A=0D#=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20mindspore/common/=5F=5Finit=5F=5F.py=0D?= =?UTF-8?q?#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/?= =?UTF-8?q?=5Fmonad.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20min?= =?UTF-8?q?dspore/common/=5Fregister=5Ffor=5Ftensor.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/api.py=0D#=09?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/dtyp?= =?UTF-8?q?e.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/?= =?UTF-8?q?common/initializer.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20?= =?UTF-8?q?=20=20=20mindspore/common/parameter.py=0D#=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20mindspore/common/seed.py=0D#=09?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/common/tens?= =?UTF-8?q?or.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore?= =?UTF-8?q?/nn/cell.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20min?= =?UTF-8?q?dspore/nn/metrics/=5F=5Finit=5F=5F.py=0D#=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20mindspore/nn/metrics/confusion=5Fmatrix?= =?UTF-8?q?.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/n?= =?UTF-8?q?n/metrics/error.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20?= =?UTF-8?q?=20=20mindspore/nn/metrics/fbeta.py=0D#=09=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=20=20=20=20=20mindspore/nn/metrics/loss.py=0D#=09?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn/metrics/?= =?UTF-8?q?metric.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20minds?= =?UTF-8?q?pore/nn/metrics/precision.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=20=20=20=20=20mindspore/nn/metrics/recall.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/nn/metrics/topk.py?= =?UTF-8?q?=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/trai?= =?UTF-8?q?n/callback/=5Fcheckpoint.py=0D#=09=E4=BF=AE=E6=94=B9=EF=BC=9A?= =?UTF-8?q?=20=20=20=20=20mindspore/train/model.py=0D#=09=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9A=20=20=20=20=20mindspore/train/serialization.?= =?UTF-8?q?py=0D#?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mindspore/common/__init__.py | 2 +- mindspore/common/_monad.py | 2 +- mindspore/common/_register_for_tensor.py | 2 +- mindspore/common/api.py | 3 +-- mindspore/common/dtype.py | 2 +- mindspore/common/initializer.py | 9 ++++----- mindspore/common/parameter.py | 4 ++-- mindspore/common/seed.py | 2 +- mindspore/common/tensor.py | 1 - mindspore/nn/cell.py | 4 ++-- mindspore/nn/metrics/__init__.py | 2 +- mindspore/nn/metrics/error.py | 2 +- mindspore/nn/metrics/fbeta.py | 2 +- mindspore/nn/metrics/loss.py | 2 +- mindspore/nn/metrics/metric.py | 2 +- mindspore/nn/metrics/precision.py | 2 +- mindspore/nn/metrics/recall.py | 2 +- mindspore/nn/metrics/topk.py | 2 +- mindspore/train/callback/_checkpoint.py | 2 +- mindspore/train/model.py | 2 +- mindspore/train/serialization.py | 8 ++++---- 21 files changed, 28 insertions(+), 31 deletions(-) diff --git a/mindspore/common/__init__.py b/mindspore/common/__init__.py index 39afd6410b3..f389bc5369e 100644 --- a/mindspore/common/__init__.py +++ b/mindspore/common/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/common/_monad.py b/mindspore/common/_monad.py index 3ea7728b6a4..37a8149dec0 100644 --- a/mindspore/common/_monad.py +++ b/mindspore/common/_monad.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/common/_register_for_tensor.py b/mindspore/common/_register_for_tensor.py index effd21dd192..45117e338e7 100644 --- a/mindspore/common/_register_for_tensor.py +++ b/mindspore/common/_register_for_tensor.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/common/api.py b/mindspore/common/api.py index c2e48b85305..ae2e1938c36 100644 --- a/mindspore/common/api.py +++ b/mindspore/common/api.py @@ -1,6 +1,6 @@ # This is the Python adaptation and derivative work of Myia (https://github.com/mila-iqia/myia/). # -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. @@ -169,7 +169,6 @@ class _MindsporeFunctionExecutor: key = generate_arguments_key(dic) phase = generate_name + '.' + str(key) if phase not in ms_compile_cache.keys(): - is_compile = False if self.obj is None: is_compile = self._graph_executor.compile(self.fn, args_list, phase, True, "") else: diff --git a/mindspore/common/dtype.py b/mindspore/common/dtype.py index 7ab147ba06a..50f8a3ceb83 100644 --- a/mindspore/common/dtype.py +++ b/mindspore/common/dtype.py @@ -1,6 +1,6 @@ # This is the Python adaptation and derivative work of Myia (https://github.com/mila-iqia/myia/). # -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/common/initializer.py b/mindspore/common/initializer.py index 57d6c1ce76a..74c663569ba 100644 --- a/mindspore/common/initializer.py +++ b/mindspore/common/initializer.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. @@ -80,7 +80,7 @@ def _register(*aliases): def _assignment(arr, num): """Assign the value of `num` to `arr`.""" if arr.shape == (): - arr = arr.reshape((1)) + arr = arr.reshape(1) arr[:] = num arr = arr.reshape(()) else: @@ -155,9 +155,8 @@ def _calculate_fan_in_and_fan_out(shape): num_input_fmaps = shape[1] num_output_fmaps = shape[0] receptive_field_size = 1 - if dimensions > 2: - for i in range(2, dimensions): - receptive_field_size *= shape[i] + for i in range(2, dimensions): + receptive_field_size *= shape[i] fan_in = num_input_fmaps * receptive_field_size fan_out = num_output_fmaps * receptive_field_size return fan_in, fan_out diff --git a/mindspore/common/parameter.py b/mindspore/common/parameter.py index af767b6043a..7e1320fb6d6 100644 --- a/mindspore/common/parameter.py +++ b/mindspore/common/parameter.py @@ -499,7 +499,7 @@ class Parameter(Tensor_): current_tensor_is_init = isinstance(self, Tensor) and not self.has_init if incoming_tensor_is_init and not current_tensor_is_init: - raise TypeError("Parameter is a `Tensor` and not initializered, `data` for `set_data`" + raise TypeError("Parameter is a `Tensor` and not initialized, `data` for `set_data`" "should be a Tensor. If you want to update it by Tensor, call method" "`init_parameters_data` of `Cell` to init and replace all the Parameter of" "network, then call this method.") @@ -515,7 +515,7 @@ class Parameter(Tensor_): from mindspore.ops import functional as F data = F.cast(data, self.dtype) if isinstance(data, Tensor) and data.has_init: - # The parameter has been initializered, directly update by the data + # The parameter has been initialized, directly update by the data if current_tensor_is_init: self._update_tensor_data(data.init_data()) else: diff --git a/mindspore/common/seed.py b/mindspore/common/seed.py index 84157a2771c..7aa75f7c248 100644 --- a/mindspore/common/seed.py +++ b/mindspore/common/seed.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/common/tensor.py b/mindspore/common/tensor.py index fdca6e5cdf5..7282125127c 100644 --- a/mindspore/common/tensor.py +++ b/mindspore/common/tensor.py @@ -734,7 +734,6 @@ class Tensor(Tensor_): axis1, axis2 = axis2, axis1 perm = tuple(range(0, self.ndim)) - new_perm = None if axis2 + 1 < self.ndim: new_perm = perm[0:axis1] + perm[axis2:axis2+1] + \ perm[axis1+1:axis2] + perm[axis1:axis1+1] + perm[axis2+1:] diff --git a/mindspore/nn/cell.py b/mindspore/nn/cell.py index b43f05de83b..c828c719421 100755 --- a/mindspore/nn/cell.py +++ b/mindspore/nn/cell.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. @@ -1294,7 +1294,7 @@ class Cell(Cell_): self._scope = prefix elif not self._scope.startswith(prefix): self._scope = prefix + self._scope - elif not self._scope is None and self._scope.startswith(prefix): + elif self._scope is not None and self._scope.startswith(prefix): self._scope = self._scope[len(prefix):] def _mp_comm_recompute(self, mp_comm_recompute=True): diff --git a/mindspore/nn/metrics/__init__.py b/mindspore/nn/metrics/__init__.py index 53a6f25ea12..263b504a1e3 100755 --- a/mindspore/nn/metrics/__init__.py +++ b/mindspore/nn/metrics/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/error.py b/mindspore/nn/metrics/error.py index 4f9e78f5cc9..86d3242d47b 100644 --- a/mindspore/nn/metrics/error.py +++ b/mindspore/nn/metrics/error.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/fbeta.py b/mindspore/nn/metrics/fbeta.py index ff5dd034ee8..973ac2ac182 100755 --- a/mindspore/nn/metrics/fbeta.py +++ b/mindspore/nn/metrics/fbeta.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/loss.py b/mindspore/nn/metrics/loss.py index d3505ef52cc..fad6c9c1bcc 100644 --- a/mindspore/nn/metrics/loss.py +++ b/mindspore/nn/metrics/loss.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/metric.py b/mindspore/nn/metrics/metric.py index 4715148febe..dfc20e815be 100644 --- a/mindspore/nn/metrics/metric.py +++ b/mindspore/nn/metrics/metric.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/precision.py b/mindspore/nn/metrics/precision.py index d7c570f38b6..8a64b95b951 100644 --- a/mindspore/nn/metrics/precision.py +++ b/mindspore/nn/metrics/precision.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/recall.py b/mindspore/nn/metrics/recall.py index c4541c313f4..4355df89b9a 100644 --- a/mindspore/nn/metrics/recall.py +++ b/mindspore/nn/metrics/recall.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/nn/metrics/topk.py b/mindspore/nn/metrics/topk.py index e7421de76e3..af52a7091d6 100644 --- a/mindspore/nn/metrics/topk.py +++ b/mindspore/nn/metrics/topk.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/train/callback/_checkpoint.py b/mindspore/train/callback/_checkpoint.py index 27d2d2f235e..33d144bf433 100644 --- a/mindspore/train/callback/_checkpoint.py +++ b/mindspore/train/callback/_checkpoint.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/train/model.py b/mindspore/train/model.py index 64c9b72b654..23786a095c5 100644 --- a/mindspore/train/model.py +++ b/mindspore/train/model.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. diff --git a/mindspore/train/serialization.py b/mindspore/train/serialization.py index cf70d6da262..9c1d0b2d3d4 100644 --- a/mindspore/train/serialization.py +++ b/mindspore/train/serialization.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 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. @@ -241,7 +241,7 @@ def save_checkpoint(save_obj, ckpt_file_name, integrated_save=True, each_param = {"name": key} param_data = Tensor(value.data) - # in automatic model parallel scenario, some parameters were spliteds to all the devices, + # in automatic model parallel scenario, some parameters were split to all the devices, # which should be combined before saving if key in save_obj.parameter_layout_dict: param_data = _get_merged_param_data(save_obj, key, param_data, integrated_save) @@ -1365,9 +1365,9 @@ def load_distributed_checkpoint(network, checkpoint_filenames, predict_strategy= param_dict[param.name] = split_param if param_not_in_strategy: - logger.warning("{} parameters in network are not in the sclice strategy.".format(param_not_in_strategy)) + logger.warning("{} parameters in network are not in the slice strategy.".format(param_not_in_strategy)) if param_not_in_ckpt: - logger.warning("{} parameters in sclice strategy but not in the checkpoint file.".format(param_not_in_ckpt)) + logger.warning("{} parameters in slice strategy but not in the checkpoint file.".format(param_not_in_ckpt)) load_param_into_net(network, param_dict)