!29496 fix the error message of Select and optimize the documentation of L1Loss and SmoothL1Loss.
Merge pull request !29496 from wangshuide/wsd_master_new
This commit is contained in:
commit
1e3f3b51d7
|
@ -26,6 +26,7 @@ mindspore.nn.Conv3dTranspose
|
|||
- **padding** (Union(int, tuple[int])) - 输入的深度、高度和宽度方向上填充的数量。数据类型为int或包含6个整数的tuple。如果 `padding` 是一个整数,则前部、后部、顶部,底部,左边和右边的填充都等于 `padding` 。如果 `padding` 是6个整数的tuple,则前部、尾部、顶部、底部、左边和右边的填充分别等于填充padding[0]、padding[1]、padding[2]、padding[3]、padding[4]和padding[5]。值应该要大于等于0,默认值:0。
|
||||
- **dilation** (Union[int, tuple[int]]) - 三维卷积核膨胀尺寸。数据类型为int或三个整数的tuple。若 :math:`k > 1` ,则kernel间隔 `k` 个元素进行采样。深度、高度和宽度方向上的 `k` ,其取值范围分别为[1, D]、[1, H]和[1, W]。默认值:1。
|
||||
- **group** (int) - 将过滤器拆分为组, `in_channels` 和 `out_channels` 必须可被 `group` 整除。当 `group` 大于1时,暂不支持Ascend平台。默认值:1。当前仅支持1。
|
||||
- **output_padding** (Union(int, tuple[int])) - 输出的深度、高度和宽度方向上填充的数量。数据类型为int或包含6个整数的tuple。如果 `output_padding` 是一个整数,则前部、后部、顶部,底部,左边和右边的填充都等于 `output_padding` 。如果 `output_padding` 是6个整数的tuple,则前部、尾部、顶部、底部、左边和右边的填充分别等于填充output_padding[0]、output_padding[1]、output_padding[2]、output_padding[3]、output_padding[4]output_padding[5]。值应该要大于等于0,默认值:0。
|
||||
- **has_bias** (bool) - Conv3dTranspose层是否添加偏置参数。默认值:False。
|
||||
- **weight_init** (Union[Tensor, str, Initializer, numbers.Number]) - 权重参数的初始化方法。它可以是Tensor,str,Initializer或numbers.Number。当使用str时,可选"TruncatedNormal","Normal","Uniform","HeUniform"和"XavierUniform"分布以及常量"One"和"Zero"分布的值,可接受别名"xavier_uniform","he_uniform","ones"和"zeros"。上述字符串大小写均可。更多细节请参考Initializer的值。默认值:"normal"。
|
||||
- **bias_init** (Union[Tensor, str, Initializer, numbers.Number]) - 偏置参数的初始化方法。可以使用的初始化方法与"weight_init"相同。更多细节请参考Initializer的值。默认值:"zeros"。
|
||||
|
|
|
@ -35,3 +35,4 @@ mindspore.nn.L1Loss
|
|||
**异常:**
|
||||
|
||||
**ValueError** - `reduction` 不为"mean"、"sum"或"none"。
|
||||
**ValueError** - `logits` 和 `labels` 有不同的shape,且不能互相广播。
|
||||
|
|
|
@ -37,6 +37,8 @@ mindspore.nn.SmoothL1Loss
|
|||
**异常:**
|
||||
|
||||
- **TypeError** - `beta` 不是float。
|
||||
- **TypeError** - `logits` 或 `labels` 不是Tensor。
|
||||
- **TypeError** - `logits` 或 `labels` 的数据类型既不是float16,也不是float32。
|
||||
- **TypeError** - `logits` 的数据类型与 `labels` 不同。
|
||||
- **ValueError** - `beta` 小于或等于0。
|
||||
- **ValueError** - `logits` 的shape与 `labels` 不同。
|
||||
|
|
|
@ -170,10 +170,7 @@ std::vector<KernelAttr> NativeCpuKernelModFactory::GetSupportedKernelAttrList(co
|
|||
std::vector<KernelAttr> result;
|
||||
auto iter = name_to_attr_creator_.find(kernel_name);
|
||||
if (iter == name_to_attr_creator_.end()) {
|
||||
MS_LOG(EXCEPTION) << "For '" << kernel_name
|
||||
<< ", only support these types: Concat, Pack, Stack, Split, Transpose, Unpack, AddN, "
|
||||
"ConcatOffset or DynamicStitch currently, but got "
|
||||
<< kernel_name;
|
||||
MS_LOG(EXCEPTION) << "Not register CPU kernel of operator: " << kernel_name;
|
||||
}
|
||||
auto creators = iter->second;
|
||||
result.reserve(creators.size());
|
||||
|
|
|
@ -62,7 +62,7 @@ abstract::BaseShapePtr SelectInferShape(const PrimitivePtr &primitive, const std
|
|||
MS_LOG(ERROR) << " cond shape :" << input_args[kCondIndex]->BuildShape()->ToString();
|
||||
MS_LOG(ERROR) << " x shape :" << input_args[kXIndex]->BuildShape()->ToString();
|
||||
MS_LOG(ERROR) << " y shape :" << input_args[kYIndex]->BuildShape()->ToString();
|
||||
MS_EXCEPTION(ValueError) << "The shape of cond, x and y should be equal";
|
||||
MS_EXCEPTION(ValueError) << "The shape of cond, x and y should be the same.";
|
||||
}
|
||||
return input_args[1]->BuildShape();
|
||||
}
|
||||
|
|
|
@ -740,7 +740,7 @@ class Conv3dTranspose(_Conv):
|
|||
:math:`dilation * (kernel\_size - 1) - padding` amount of zero will be paded to the depth, height and width
|
||||
directions of the input, they are inverses of each other in regard to the input and output shapes in this case.
|
||||
However, when `stride` > 1, Conv2d maps multiple input shapes to the same output shape. Deconvolutional network
|
||||
can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/matzeiler/deconvolutionalnetworks.pdf>`_.
|
||||
can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf>`_.
|
||||
|
||||
Args:
|
||||
in_channels (int): The channel number of the input tensor of the Conv3dTranspose layer.
|
||||
|
@ -777,6 +777,13 @@ class Conv3dTranspose(_Conv):
|
|||
[1, D], [1, H] and [1, W] respectively. Default: 1.
|
||||
group (int): Splits filter into groups, `in_channels` and `out_channels` must be
|
||||
divisible by `group`. Default: 1. Only 1 is currently supported.
|
||||
output_padding (Union(int, tuple[int])): The number of padding on the depth, height and width directions of
|
||||
the output. The data type is an integer or a tuple of six integers. If `output_padding` is an integer,
|
||||
then the head, tail, top, bottom, left, and right padding are all equal to `output_padding`.
|
||||
If `output_padding` is a tuple of six integers, then the head, tail, top, bottom, left, and right padding
|
||||
is equal to `output_padding[0]`, `output_padding[1]`, `output_padding[2]`, `output_padding[3]`,
|
||||
`output_padding[4]` and `output_padding[5]` respectively. The value should be greater than or equal to 0.
|
||||
Default: 0.
|
||||
has_bias (bool): Whether the Conv3dTranspose layer has a bias parameter. Default: False.
|
||||
weight_init (Union[Tensor, str, Initializer, numbers.Number]): Initialization method of weight parameter.
|
||||
It can be a Tensor, a string, an Initializer or a numbers.Number. When a string is specified,
|
||||
|
@ -961,7 +968,7 @@ class Conv2dTranspose(_Conv):
|
|||
:math:`dilation * (kernel\_size - 1) - padding` amount of zero will be paded to the height and width
|
||||
directions of the input, they are inverses of each other in regard to the input and output shapes in this case.
|
||||
However, when `stride` > 1, Conv2d maps multiple input shapes to the same output shape. Deconvolutional network
|
||||
can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/matzeiler/deconvolutionalnetworks.pdf>`_.
|
||||
can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf>`_.
|
||||
|
||||
Args:
|
||||
in_channels (int): The channel number of the input tensor of the Conv2dTranspose layer.
|
||||
|
@ -1171,7 +1178,7 @@ class Conv1dTranspose(_Conv):
|
|||
:math:`dilation * (kernel\_size - 1) - padding` amount of zero will be paded to both sizes of input,
|
||||
they are inverses of each other in regard to the input and output shapes in this case.
|
||||
However, when `stride` > 1, Conv1d maps multiple input shapes to the same output shape. Deconvolutional network
|
||||
can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/matzeiler/deconvolutionalnetworks.pdf>`_.
|
||||
can refer to `Deconvolutional Networks <https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf>`_.
|
||||
|
||||
Args:
|
||||
in_channels (int): The channel number of the input tensor of the Conv1dTranspose layer.
|
||||
|
|
|
@ -471,7 +471,7 @@ class SmoothL1Loss(LossBase):
|
|||
TypeError: If `beta` is not a float.
|
||||
TypeError: If `logits` or `labels` are not Tensor.
|
||||
TypeError: If dtype of `logits` or `labels` is neither float16 not float32.
|
||||
TypeError: If dtype of `logits` or `labels` are not the same.
|
||||
TypeError: If dtype of `logits` is not the same as `labels`.
|
||||
ValueError: If `beta` is less than or equal to 0.
|
||||
ValueError: If shape of `logits` is not the same as `labels`.
|
||||
|
||||
|
|
Loading…
Reference in New Issue