forked from mindspore-Ecosystem/mindspore
fixed range
This commit is contained in:
parent
a9d06edae9
commit
5d9421b92c
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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)`.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue