未验证 提交 6f7e768c 编写于 作者: C carryyu 提交者: GitHub

test=infer-coverage fix A10 test_fc_elementwise_layernorm_fuse_pass (#46651)

上级 89d481db
......@@ -20,6 +20,19 @@ import unittest
import hypothesis.strategies as st
class FcElementLayernormFusePassDataGen:
def __init__(self, min_v, max_v, shape, dtype):
self.min_v = min_v
self.max_v = max_v
self.shape = shape
self.dtype = dtype
def __call__(self):
return np.random.normal(self.min_v, self.max_v,
self.shape).astype(self.dtype)
class TestFCElementwiseLayerNormFusePass(PassAutoScanTest):
"""
x_var w(persistable) bias_var(persistable)
......@@ -116,11 +129,18 @@ class TestFCElementwiseLayerNormFusePass(PassAutoScanTest):
program_config = ProgramConfig(
ops=ops,
weights={
"fc_w": TensorConfig(shape=w_shape),
"fc_bias": TensorConfig(shape=fc_bias_shape),
"add_bias": TensorConfig(shape=add_bias_shape),
"scale": TensorConfig(shape=layer_norm_shape),
"layer_norm_bias": TensorConfig(shape=layer_norm_shape),
"fc_w":
TensorConfig(shape=w_shape),
"fc_bias":
TensorConfig(shape=fc_bias_shape),
"add_bias":
TensorConfig(shape=add_bias_shape),
"scale":
TensorConfig(shape=layer_norm_shape,
data_gen=FcElementLayernormFusePassDataGen(
0.0, 0.5, layer_norm_shape, np.float32)),
"layer_norm_bias":
TensorConfig(shape=layer_norm_shape),
},
inputs={
"fc_x": TensorConfig(shape=x_shape),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册