diff --git a/python/paddle/fluid/tests/unittests/test_dygraph_mnist_fp16.py b/python/paddle/fluid/tests/unittests/test_dygraph_mnist_fp16.py index 0efc887384dbaad3309becaf132fcd466a042aaf..7503a9172fc21bc343011d39c4c785daab9a1d7f 100644 --- a/python/paddle/fluid/tests/unittests/test_dygraph_mnist_fp16.py +++ b/python/paddle/fluid/tests/unittests/test_dygraph_mnist_fp16.py @@ -121,7 +121,7 @@ class TestMnist(unittest.TestCase): if not fluid.is_compiled_with_cuda(): return x = np.random.randn(1, 3, 224, 224).astype("float16") - y = np.random.randn(1, 1).astype("int64") + y = np.random.randint(10, size=[1, 1], dtype="int64") with fluid.dygraph.guard(fluid.CUDAPlace(0)): model = MNIST(dtype="float16") x = fluid.dygraph.to_variable(x)