|
|
@ -182,12 +182,11 @@ class TestDataNormOp(OpTest):
|
|
|
|
self.op_type = 'data_norm'
|
|
|
|
self.op_type = 'data_norm'
|
|
|
|
self.use_mkldnn = False
|
|
|
|
self.use_mkldnn = False
|
|
|
|
epsilon = 0.00001
|
|
|
|
epsilon = 0.00001
|
|
|
|
x_shape = [2, 3]
|
|
|
|
x_shape = [10, 12]
|
|
|
|
scale_shape = [3]
|
|
|
|
scale_shape = [12]
|
|
|
|
tp = np.float32
|
|
|
|
tp = np.float32
|
|
|
|
|
|
|
|
|
|
|
|
x_val = np.array([[-0.35702616, -0.42756206, -0.08306625],
|
|
|
|
x_val = np.random.random(x_shape).astype(tp)
|
|
|
|
[0.41199666, -0.21719968, -0.10180971]]).astype(tp)
|
|
|
|
|
|
|
|
batch_size = np.ones(scale_shape).astype(tp)
|
|
|
|
batch_size = np.ones(scale_shape).astype(tp)
|
|
|
|
batch_size *= 1e4
|
|
|
|
batch_size *= 1e4
|
|
|
|
batch_sum = np.zeros(scale_shape).astype(tp)
|
|
|
|
batch_sum = np.zeros(scale_shape).astype(tp)
|
|
|
@ -196,8 +195,8 @@ class TestDataNormOp(OpTest):
|
|
|
|
|
|
|
|
|
|
|
|
y = np.array(x_val)
|
|
|
|
y = np.array(x_val)
|
|
|
|
|
|
|
|
|
|
|
|
mean = np.array([[0, 0, 0], [0, 0, 0]]).astype(tp)
|
|
|
|
mean = np.zeros(x_shape).astype(tp)
|
|
|
|
scale = np.array([[1, 1, 1], [1, 1, 1]]).astype(tp)
|
|
|
|
scale = np.ones(x_shape).astype(tp)
|
|
|
|
|
|
|
|
|
|
|
|
self.inputs = {
|
|
|
|
self.inputs = {
|
|
|
|
"X": x_val,
|
|
|
|
"X": x_val,
|
|
|
|