| @@ -15,6 +15,7 @@ | |||||
| """math""" | """math""" | ||||
| import math | import math | ||||
| from mindspore.ops import operations as P | from mindspore.ops import operations as P | ||||
| from mindspore.ops.operations import _inner_ops as inner | |||||
| from mindspore.common.tensor import Tensor | from mindspore.common.tensor import Tensor | ||||
| from ..cell import Cell | from ..cell import Cell | ||||
| from ...common import dtype as mstype | from ...common import dtype as mstype | ||||
| @@ -114,7 +115,7 @@ class Range(Cell): | |||||
| limit = float(limit) | limit = float(limit) | ||||
| if isinstance(delta, int): | if isinstance(delta, int): | ||||
| delta = float(delta) | delta = float(delta) | ||||
| self.range_x = P.Range(start, limit, delta) | |||||
| self.range_x = inner.Range(start, limit, delta) | |||||
| if limit is None: | if limit is None: | ||||
| length_input = math.ceil(start / delta) | length_input = math.ceil(start / delta) | ||||
| else: | else: | ||||
| @@ -375,7 +375,7 @@ class GlobalBatchNorm(_BatchNorm): | |||||
| Args: | Args: | ||||
| num_features (int): `C` from an expected input of size (N, C, H, W). | 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. | eps (float): A value added to the denominator for numerical stability. Default: 1e-5. | ||||
| momentum (float): A floating hyperparameter of the momentum for the | momentum (float): A floating hyperparameter of the momentum for the | ||||
| running_mean and running_var computation. Default: 0.9. | running_mean and running_var computation. Default: 0.9. | ||||
| @@ -122,8 +122,8 @@ class SameTypeShape(PrimitiveWithInfer): | |||||
| Checks whether data type and shape of two tensors are the same. | Checks whether data type and shape of two tensors are the same. | ||||
| Raises: | 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: | Inputs: | ||||
| - **input_x** (Tensor) - The shape of tensor is :math:`(x_1, x_2, ..., x_R)`. | - **input_x** (Tensor) - The shape of tensor is :math:`(x_1, x_2, ..., x_R)`. | ||||
| @@ -673,7 +673,7 @@ class BatchNorm(PrimitiveWithInfer): | |||||
| >>> mean = Tensor(np.ones([64]), mindspore.float32) | >>> mean = Tensor(np.ones([64]), mindspore.float32) | ||||
| >>> variance = Tensor(np.ones([64]), mindspore.float32) | >>> variance = Tensor(np.ones([64]), mindspore.float32) | ||||
| >>> batch_norm = P.BatchNorm() | >>> 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 | @prim_attr_register | ||||