!10963 Modify indices supported dtype of SparseApplyProximalAdagrad.

From: @liu_xiao_93
Reviewed-by: @liangchenghui,@wuxuejian
Signed-off-by: @liangchenghui
This commit is contained in:
mindspore-ci-bot 2021-01-05 18:55:46 +08:00 committed by Gitee
commit 6c8ded0931
1 changed files with 2 additions and 3 deletions

View File

@ -5187,7 +5187,7 @@ class SparseApplyProximalAdagrad(PrimitiveWithCheck):
- **grad** (Tensor) - A tensor of the same type as `var`, for the gradient.
- **indices** (Tensor) - A tensor of indices in the first dimension of `var` and `accum`.
If there are duplicates in `indices`, the behavior is undefined. Must be one of the
following types: int16, int32, int64, uint16, uint32, uint64.
following types: int32, int64.
Outputs:
Tuple of 2 tensors, the updated parameters.
@ -5253,8 +5253,7 @@ class SparseApplyProximalAdagrad(PrimitiveWithCheck):
validator.check_scalar_or_tensor_types_same({"lr": lr_dtype}, [mstype.float16, mstype.float32], self.name)
validator.check_scalar_or_tensor_types_same({"l1": l1_dtype}, [mstype.float16, mstype.float32], self.name)
validator.check_scalar_or_tensor_types_same({"l2": l2_dtype}, [mstype.float16, mstype.float32], self.name)
valid_dtypes = [mstype.int16, mstype.int32, mstype.int64,
mstype.uint16, mstype.uint32, mstype.uint64]
valid_dtypes = [mstype.int32, mstype.int64]
validator.check_tensor_dtype_valid('indices', indices_dtype, valid_dtypes, self.name)