From 5d9421b92c0bf1af28aa0337e2e2e42aeebbde1f Mon Sep 17 00:00:00 2001 From: jiangjinsheng Date: Fri, 19 Jun 2020 09:28:02 +0800 Subject: [PATCH] fixed range --- mindspore/nn/layer/math.py | 3 ++- mindspore/nn/layer/normalization.py | 2 +- mindspore/ops/operations/array_ops.py | 4 ++-- mindspore/ops/operations/nn_ops.py | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mindspore/nn/layer/math.py b/mindspore/nn/layer/math.py index acd18d34de..78652e5a40 100644 --- a/mindspore/nn/layer/math.py +++ b/mindspore/nn/layer/math.py @@ -15,6 +15,7 @@ """math""" import math from mindspore.ops import operations as P +from mindspore.ops.operations import _inner_ops as inner from mindspore.common.tensor import Tensor from ..cell import Cell from ...common import dtype as mstype @@ -114,7 +115,7 @@ class Range(Cell): limit = float(limit) if isinstance(delta, int): delta = float(delta) - self.range_x = P.Range(start, limit, delta) + self.range_x = inner.Range(start, limit, delta) if limit is None: length_input = math.ceil(start / delta) else: diff --git a/mindspore/nn/layer/normalization.py b/mindspore/nn/layer/normalization.py index 8ffb7664f0..2e4af18085 100644 --- a/mindspore/nn/layer/normalization.py +++ b/mindspore/nn/layer/normalization.py @@ -375,7 +375,7 @@ class GlobalBatchNorm(_BatchNorm): Args: num_features (int): `C` from an expected input of size (N, C, H, W). - device_num_each_group (int): The number of devices in each group. + device_num_each_group (int): The number of devices in each group. Default: 1. 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. diff --git a/mindspore/ops/operations/array_ops.py b/mindspore/ops/operations/array_ops.py index c21550b856..2bb8a17a50 100644 --- a/mindspore/ops/operations/array_ops.py +++ b/mindspore/ops/operations/array_ops.py @@ -122,8 +122,8 @@ class SameTypeShape(PrimitiveWithInfer): Checks whether data type and shape of two tensors are the same. Raises: - TypeError - If data type not the same. - ValueError - If shape of two tensors not the same. + TypeError: If data type not the same. + ValueError: If shape of two tensors not the same. Inputs: - **input_x** (Tensor) - The shape of tensor is :math:`(x_1, x_2, ..., x_R)`. diff --git a/mindspore/ops/operations/nn_ops.py b/mindspore/ops/operations/nn_ops.py index 78c777f0f9..4725d812eb 100644 --- a/mindspore/ops/operations/nn_ops.py +++ b/mindspore/ops/operations/nn_ops.py @@ -673,7 +673,7 @@ class BatchNorm(PrimitiveWithInfer): >>> mean = Tensor(np.ones([64]), mindspore.float32) >>> variance = Tensor(np.ones([64]), mindspore.float32) >>> batch_norm = P.BatchNorm() - >>> output = batch_norm(input_x, scale, bias, mean, variance + >>> output = batch_norm(input_x, scale, bias, mean, variance) """ @prim_attr_register