未验证 提交 ccd2d06a 编写于 作者: X xiaoting 提交者: GitHub

fix tribilinear unitest, test=release/2.0 (#24081)

* fix tribilinear unitest, test=release/2.0

* add random seed,test=release/2.0
上级 c5707159
...@@ -21,7 +21,7 @@ import paddle.fluid.core as core ...@@ -21,7 +21,7 @@ import paddle.fluid.core as core
import paddle.fluid as fluid import paddle.fluid as fluid
import paddle import paddle
from paddle.fluid import Program, program_guard from paddle.fluid import Program, program_guard
from paddle.nn.functional import * from paddle.nn.functional import interpolate
def cubic_1(x, a): def cubic_1(x, a):
...@@ -265,7 +265,7 @@ class TestBicubicInterpDataLayout(TestBicubicInterpOp): ...@@ -265,7 +265,7 @@ class TestBicubicInterpDataLayout(TestBicubicInterpOp):
class TestBicubicInterpOpAPI(unittest.TestCase): class TestBicubicInterpOpAPI(unittest.TestCase):
def test_case(self): def test_case(self):
np.random.seed(200)
x_data = np.random.random((2, 3, 6, 6)).astype("float32") x_data = np.random.random((2, 3, 6, 6)).astype("float32")
dim_data = np.array([12]).astype("int32") dim_data = np.array([12]).astype("int32")
shape_data = np.array([12, 12]).astype("int32") shape_data = np.array([12, 12]).astype("int32")
......
...@@ -19,7 +19,7 @@ import numpy as np ...@@ -19,7 +19,7 @@ import numpy as np
from op_test import OpTest from op_test import OpTest
import paddle.fluid.core as core import paddle.fluid.core as core
import paddle.fluid as fluid import paddle.fluid as fluid
from paddle.nn.functional import * from paddle.nn.functional import interpolate
def trilinear_interp_np(input, def trilinear_interp_np(input,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册