From a9617aec883182a2c449753a81df59d0a6de6598 Mon Sep 17 00:00:00 2001 From: liuxiao93 Date: Sat, 26 Dec 2020 10:54:52 +0800 Subject: [PATCH] fix Supported Platforms api. fix msssim. --- mindspore/nn/layer/image.py | 3 ++- mindspore/ops/operations/nn_ops.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mindspore/nn/layer/image.py b/mindspore/nn/layer/image.py index d693bd374e..e577a45fdd 100644 --- a/mindspore/nn/layer/image.py +++ b/mindspore/nn/layer/image.py @@ -338,7 +338,8 @@ class MSSSIM(Cell): def construct(self, img1, img2): _check_input_4d(F.shape(img1), "img1", self.cls_name) _check_input_4d(F.shape(img2), "img2", self.cls_name) - _check_input_dtype(F.dtype(img1), 'img1', mstype.number_type, self.cls_name) + valid_type = [mstype.float64, mstype.float32, mstype.float16, mstype.uint8] + _check_input_dtype(F.dtype(img1), 'img1', valid_type, self.cls_name) P.SameTypeShape()(img1, img2) dtype_max_val = _get_dtype_max(F.dtype(img1)) max_val = F.scalar_cast(self.max_val, F.dtype(img1)) diff --git a/mindspore/ops/operations/nn_ops.py b/mindspore/ops/operations/nn_ops.py index 45a89023c9..c2f7082b99 100644 --- a/mindspore/ops/operations/nn_ops.py +++ b/mindspore/ops/operations/nn_ops.py @@ -6435,7 +6435,7 @@ class DynamicRNN(PrimitiveWithInfer): Has the same type with input `b`. Supported Platforms: - ``Ascend`` + ``Ascend`` Examples: >>> x = Tensor(np.random.rand(2, 16, 64).astype(np.float16)) @@ -6570,7 +6570,7 @@ class DynamicGRUV2(PrimitiveWithInfer): - If `bias_input` is `None` and `bias_hidden` is not `None, `bias_type` is the date type of `bias_hidden`. Supported Platforms: - ``Ascend`` + ``Ascend`` Examples: >>> x = Tensor(np.random.rand(2, 8, 64).astype(np.float16))