提交 a90f3507 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!62 fix a bug that test case test_apply_adagrad_001.py run failed

Merge pull request !62 from hanhuifeng/adagrad_case_bug
......@@ -34,8 +34,9 @@ def apply_adagrad_execute(shape, dtype, update_slots, attrs=None):
def gen_data(dtype, update_slots, shape):
var = random_gaussian(shape, miu=1, sigma=0.1).astype(dtype)
# accum must be greater than or equal to 0
accum = np.abs(random_gaussian(shape, miu=1, sigma=0.1).astype(dtype))
# accum must be greater than 0
epsilon = 1e-7 if dtype == np.float32 else 1e-3
accum = np.abs(random_gaussian(shape, miu=1, sigma=0.1).astype(dtype)) + epsilon
lr = random_gaussian((1,), miu=1, sigma=0.1).astype(dtype)
grad = random_gaussian(shape, miu=1, sigma=0.1).astype(dtype)
inputs = [var, accum, lr, grad]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册