From 19a5e14b31ad4f0dc38d425c25f8abff8cb758f0 Mon Sep 17 00:00:00 2001 From: fary86 Date: Tue, 14 Apr 2020 21:38:00 +0800 Subject: [PATCH] Fix BatchNorm1d and BatchNorm2d doc bug, and slog print source path twice in log --- mindspore/ccsrc/utils/log_adapter.cc | 7 +++++++ mindspore/nn/layer/normalization.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/mindspore/ccsrc/utils/log_adapter.cc b/mindspore/ccsrc/utils/log_adapter.cc index 19482ec1939..eed68cf8593 100644 --- a/mindspore/ccsrc/utils/log_adapter.cc +++ b/mindspore/ccsrc/utils/log_adapter.cc @@ -96,6 +96,13 @@ static int GetGlogLevel(MsLogLevel level) { } } #else + +#undef Dlog +#define Dlog(module_id, level, format, ...) \ + do { \ + DlogInner((module_id), (level), (format), ##__VA_ARGS__); \ + } while (0) + // convert MsLogLevel to corresponding slog level static int GetSlogLevel(MsLogLevel level) { switch (level) { diff --git a/mindspore/nn/layer/normalization.py b/mindspore/nn/layer/normalization.py index d5082371c12..2df064353f5 100644 --- a/mindspore/nn/layer/normalization.py +++ b/mindspore/nn/layer/normalization.py @@ -136,6 +136,7 @@ class BatchNorm1d(_BatchNorm): eps (float): A value added to the denominator for numerical stability. Default: 1e-5. momentum (float): A floating hyperparameter of the momentum for the running_mean and running_var computation. Default: 0.9. + affine (bool): A bool value when set to True, gamma and beta can be learnable. Default: True. gamma_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the gamma weight. The values of str refer to the function `initializer` including 'zeros', 'ones', 'xavier_uniform', 'he_uniform', etc. Default: 'ones'. @@ -187,6 +188,7 @@ class BatchNorm2d(_BatchNorm): eps (float): A value added to the denominator for numerical stability. Default: 1e-5. momentum (float): A floating hyperparameter of the momentum for the running_mean and running_var computation. Default: 0.9. + affine (bool): A bool value when set to True, gamma and beta can be learnable. Default: True. gamma_init (Union[Tensor, str, Initializer, numbers.Number]): Initializer for the gamma weight. The values of str refer to the function `initializer` including 'zeros', 'ones', 'xavier_uniform', 'he_uniform', etc. Default: 'ones'.