[MSLITE] Fix docs of uniform

This commit is contained in:
wang_shaocong 2022-12-24 11:53:31 +08:00
parent d080356efe
commit a89a0f53f3
5 changed files with 9 additions and 8 deletions

View File

@ -18,7 +18,7 @@ mindspore.ops.UniformInt
- **seed2** (int) - 随机种子2用来防止随机种子冲突非负值。默认值0。
输入:
- **shape** (tuple) - 目标Tensor的shape。只允许常量值。
- **shape** (Union[tuple, Tensor]) - 目标Tensor的shape。只允许常量值。
- **minval** (Tensor) - 分布参数, :math:`a`
决定可能生成的最小值数据类型为int32。需为标量。
- **maxval** (Tensor) - 分布参数, :math:`b`
@ -29,6 +29,6 @@ mindspore.ops.UniformInt
异常:
- **TypeError** - `seed``seed2` 不是int类型。
- **TypeError** - `shape` 不是Tuple
- **TypeError** - `shape` 不是tuple或Tensor
- **TypeError** - `minval``maxval` 不是Tensor。
- **ValueError** - `shape` 不是常量值。

View File

@ -17,12 +17,12 @@ mindspore.ops.UniformReal
- 全局的随机种子和算子层的随机种子都设置了:全局的随机种子和算子层的随机种子拼接。
输入:
- **shape** (tuple) - 待生成的Tensor的shape。只支持常量值。
- **shape** (Union[tuple, Tensor]) - 待生成的Tensor的shape。只支持常量值。
输出:
Tensor。它的shape为输入 `shape`。数据类型为float32。
异常:
- **TypeError** - `seed``seed2` 不是int。
- **TypeError** - `shape` 不是tuple。
- **TypeError** - `shape` 不是tuple或Tensor
- **ValueError** - `shape` 不是常量值。

View File

@ -142,7 +142,8 @@ bool RandomCpuKernelMod::Launch(const std::vector<kernel::AddressPtr> &inputs,
} else {
#if defined(_WIN32) || defined(_WIN64)
HCRYPTPROV h_crypt_prov;
if (!CryptAcquireContext(reinterpret_cast<HCRYPTPROV *>(&h_crypt_prov), nullptr, nullptr, PROV_RSA_FULL, 0)) {
if (!CryptAcquireContext(reinterpret_cast<HCRYPTPROV *>(&h_crypt_prov), nullptr, nullptr, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
auto err_code = GetLastError();
MS_LOG(EXCEPTION) << "Acquire crypt context failed when generate a seed value for the random operator: "
<< kernel_type_ << ". The error code: " << err_code;

View File

@ -232,7 +232,7 @@ def uniform(shape, minval, maxval, seed=None, dtype=mstype.float32):
The dtype is designated as the input `dtype`.
Raises:
TypeError: If `shape` is neither a tuple nor a tensor.
TypeError: If `shape` is neither a tuple nor a Tensor.
TypeError: If 'minval' or 'maxval' is neither int32 nor float32
and dtype of 'minval' is not the same as 'maxval'.
TypeError: If `seed` is not an int.

View File

@ -612,7 +612,7 @@ class UniformInt(Primitive):
Raises:
TypeError: If neither `seed` nor `seed2` is an int.
TypeError: If `shape` is neither a tuple nor a tensor.
TypeError: If `shape` is neither a tuple nor a Tensor.
TypeError: If neither `minval` nor `maxval` is a Tensor.
ValueError: If `shape` is not a constant value.
@ -666,7 +666,7 @@ class UniformReal(Primitive):
Raises:
TypeError: If `seed` or `seed2` is not an int.
TypeError: If `shape` is neither a tuple nor a tensor.
TypeError: If `shape` is neither a tuple nor a Tensor.
ValueError: If `shape` is not a constant value.
Supported Platforms: