forked from huawei/mindspore2022
!29360 adapt some cpp ut for unused nodes eliminate
Merge pull request !29360 from huanghui/fix-unused-output-in-ascend-pass
This commit is contained in:
commit
9aa25eaa35
|
|
@ -44,9 +44,7 @@ TEST_F(TestHWBatchNormBertFission, test_fused_batch_norm_fission) {
|
|||
EXPECT_NE(ret, nullptr);
|
||||
auto make_tuple0 = ret->input(1);
|
||||
EXPECT_NE(make_tuple0, nullptr);
|
||||
auto tuple_getitem0 = make_tuple0->cast<CNodePtr>()->input(1);
|
||||
EXPECT_NE(tuple_getitem0, nullptr);
|
||||
auto make_tuple1 = tuple_getitem0->cast<CNodePtr>()->input(1);
|
||||
auto make_tuple1 = make_tuple0->cast<CNodePtr>()->input(1);
|
||||
EXPECT_NE(make_tuple1, nullptr);
|
||||
auto tuple_getitem1 = make_tuple1->cast<CNodePtr>()->input(1);
|
||||
EXPECT_NE(tuple_getitem1, nullptr);
|
||||
|
|
|
|||
|
|
@ -60,8 +60,7 @@ def test_adam_apply_one_fusion(tag):
|
|||
mul4 = Mul(input4, true_div0)
|
||||
sub0 = Sub(input3, mul4)
|
||||
outputs = make_tuple(add1, add0, sub0)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond1(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -78,8 +77,7 @@ def test_adam_apply_one_fusion(tag):
|
|||
mul4 = Mul(input4, true_div0)
|
||||
sub0 = Sub(input3, mul4)
|
||||
outputs = make_tuple(add1, add0, sub0)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond2(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -96,8 +94,7 @@ def test_adam_apply_one_fusion(tag):
|
|||
mul4 = Mul(true_div0, input4)
|
||||
sub0 = Sub(input3, mul4)
|
||||
outputs = make_tuple(add1, add0, sub0)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond3(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -114,8 +111,7 @@ def test_adam_apply_one_fusion(tag):
|
|||
mul4 = Mul(true_div0, input4)
|
||||
sub0 = Sub(input3, mul4)
|
||||
outputs = make_tuple(add1, add0, sub0)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond4(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -132,16 +128,14 @@ def test_adam_apply_one_fusion(tag):
|
|||
mul4 = Mul(true_div0, input4)
|
||||
sub0 = Sub(input3, mul4)
|
||||
outputs = make_tuple(add1, add0, sub0)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
adam_apply_one = AdamApplyOne(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y)
|
||||
outputs = make_tuple(tuple_getitem(adam_apply_one, 0), tuple_getitem(adam_apply_one, 1),
|
||||
tuple_getitem(adam_apply_one, 2))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -170,8 +164,7 @@ def test_adam_apply_one_assign_fusion(tag):
|
|||
assign2 = Assign(input1, add1)
|
||||
depend2 = F.depend(depend1, assign2)
|
||||
outputs = make_tuple(add1, add0, depend2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond1(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -194,8 +187,7 @@ def test_adam_apply_one_assign_fusion(tag):
|
|||
assign2 = Assign(input1, add1)
|
||||
depend2 = F.depend(depend1, assign2)
|
||||
outputs = make_tuple(add1, add0, depend2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond2(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -218,8 +210,7 @@ def test_adam_apply_one_assign_fusion(tag):
|
|||
assign2 = Assign(input1, add1)
|
||||
depend2 = F.depend(depend1, assign2)
|
||||
outputs = make_tuple(add1, add0, depend2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond3(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -242,8 +233,7 @@ def test_adam_apply_one_assign_fusion(tag):
|
|||
assign2 = Assign(input1, add1)
|
||||
depend2 = F.depend(depend1, assign2)
|
||||
outputs = make_tuple(add1, add0, depend2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_cond4(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -266,8 +256,7 @@ def test_adam_apply_one_assign_fusion(tag):
|
|||
assign2 = Assign(input1, add1)
|
||||
depend2 = F.depend(depend1, assign2)
|
||||
outputs = make_tuple(add1, add0, depend2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, mul0_x, mul1_x, mul2_x, mul3_x, add2_y):
|
||||
|
|
@ -275,7 +264,6 @@ def test_adam_apply_one_assign_fusion(tag):
|
|||
mul3_x, add2_y)
|
||||
outputs = make_tuple(tuple_getitem(adam_apply_one_assign, 0), tuple_getitem(adam_apply_one_assign, 1),
|
||||
tuple_getitem(adam_apply_one_assign, 2))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ def test_batch_norm_bert_fission(tag):
|
|||
def before(input0, input1, input2, input3, input4):
|
||||
batch_norm = BatchNorm(input0, input1, input2, input3, input4)
|
||||
outputs = make_tuple(tuple_getitem(batch_norm, 0), tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4):
|
||||
|
|
@ -51,7 +50,6 @@ def test_batch_norm_bert_fission(tag):
|
|||
tuple_getitem(bn_training_reduce, 1), input1, input2)
|
||||
outputs = make_tuple(tuple_getitem(bn_training_update_v2, 0), tuple_getitem(bn_training_update_v2, 1),
|
||||
tuple_getitem(bn_training_update_v2, 2))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
|
|
@ -42,22 +42,19 @@ def test_batch_norm_grad_infer_fission(tag):
|
|||
def before(input0, input1, input2, input3, input4, input5):
|
||||
batch_norm = BatchNormGradInfer(input0, input1, input2, input3, input4, input5)
|
||||
outputs = make_tuple(tuple_getitem(batch_norm, 0), tuple_getitem(batch_norm, 1), tuple_getitem(batch_norm, 2))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_is_training(input0, input1, input2, input3, input4, input5):
|
||||
batch_norm = BatchNormGradTraining(input0, input1, input2, input3, input4, input5)
|
||||
outputs = make_tuple(tuple_getitem(batch_norm, 0), tuple_getitem(batch_norm, 1), tuple_getitem(batch_norm, 2))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_output3_not_null(input0, input1, input2, input3, input4, input5):
|
||||
batch_norm = BatchNormGradInfer(input0, input1, input2, input3, input4, input5)
|
||||
outputs = make_tuple(tuple_getitem(batch_norm, 0), tuple_getitem(batch_norm, 1), tuple_getitem(batch_norm, 2))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5):
|
||||
|
|
@ -66,7 +63,6 @@ def test_batch_norm_grad_infer_fission(tag):
|
|||
outputs = make_tuple(bn_infer_grad, tuple_getitem(bn_training_update_grad, 0),
|
||||
tuple_getitem(bn_training_update_grad, 1))
|
||||
new_outputs = make_tuple(tuple_getitem(outputs, 0), tuple_getitem(outputs, 1), tuple_getitem(outputs, 2))
|
||||
output = tuple_getitem(new_outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(new_outputs)
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@ def test_fused_batch_norm_fusion(tag):
|
|||
depend0 = F.depend(tuple_getitem(batch_norm, 0), assign_sub0)
|
||||
depend1 = F.depend(depend0, assign_sub1)
|
||||
outputs = make_tuple(depend1, tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4), u1)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_mix_precision0(input0, input1, input2, input3, input4, var0, var1):
|
||||
|
|
@ -80,8 +79,7 @@ def test_fused_batch_norm_fusion(tag):
|
|||
depend0 = F.depend(tuple_getitem(batch_norm, 0), assign_sub0)
|
||||
depend1 = F.depend(depend0, assign_sub1)
|
||||
outputs = make_tuple(depend1, tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4), u1)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_mix_precision1(input0, input1, input2, input3, input4, var0, var1):
|
||||
|
|
@ -97,8 +95,7 @@ def test_fused_batch_norm_fusion(tag):
|
|||
depend0 = F.depend(tuple_getitem(batch_norm, 0), assign_sub0)
|
||||
depend1 = F.depend(depend0, assign_sub1)
|
||||
outputs = make_tuple(depend1, tuple_getitem(batch_norm, 3), tuple_getitem(batch_norm, 4), u1)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, var0, var1):
|
||||
|
|
@ -107,7 +104,6 @@ def test_fused_batch_norm_fusion(tag):
|
|||
tuple_getitem(bn_training_reduce, 1), input1, input2, var0, var1)
|
||||
outputs = make_tuple(tuple_getitem(bn_training_update, 0), tuple_getitem(bn_training_update, 3),
|
||||
tuple_getitem(bn_training_update, 4), U)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
|
|
@ -58,8 +58,7 @@ def test_lamb_next_mv_rule_cond4(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -69,8 +68,7 @@ def test_lamb_next_mv_rule_cond4(tag):
|
|||
constant_mul4_x, constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv, 0), tuple_getitem(lamb_next_mv, 1),
|
||||
tuple_getitem(lamb_next_mv, 2), tuple_getitem(lamb_next_mv, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def before_unmatched_real_div4(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -93,8 +91,7 @@ def test_lamb_next_mv_rule_cond4(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched_real_div0(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -117,8 +114,7 @@ def test_lamb_next_mv_rule_cond4(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched_real_div1(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -141,8 +137,7 @@ def test_lamb_next_mv_rule_cond4(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched_real_div2(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -165,8 +160,7 @@ def test_lamb_next_mv_rule_cond4(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -193,8 +187,7 @@ def test_lamb_next_mv_rule_cond1(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -204,8 +197,7 @@ def test_lamb_next_mv_rule_cond1(tag):
|
|||
constant_mul4_x, constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv, 0), tuple_getitem(lamb_next_mv, 1),
|
||||
tuple_getitem(lamb_next_mv, 2), tuple_getitem(lamb_next_mv, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def un_match(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -228,8 +220,7 @@ def test_lamb_next_mv_rule_cond1(tag):
|
|||
mul4 = Mul(constant_mul4_x, input6)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -256,8 +247,7 @@ def test_lamb_next_mv_rule_cond2(tag):
|
|||
mul4 = Mul(input6, constant_mul4_x)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -267,8 +257,7 @@ def test_lamb_next_mv_rule_cond2(tag):
|
|||
constant_mul4_x, constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv, 0), tuple_getitem(lamb_next_mv, 1),
|
||||
tuple_getitem(lamb_next_mv, 2), tuple_getitem(lamb_next_mv, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def un_match(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -291,8 +280,7 @@ def test_lamb_next_mv_rule_cond2(tag):
|
|||
mul4 = Mul(input6, constant_mul4_x)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -319,8 +307,7 @@ def test_lamb_next_mv_rule_cond3(tag):
|
|||
mul4 = Mul(input6, constant_mul4_x)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -330,8 +317,7 @@ def test_lamb_next_mv_rule_cond3(tag):
|
|||
constant_mul4_x, constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv, 0), tuple_getitem(lamb_next_mv, 1),
|
||||
tuple_getitem(lamb_next_mv, 2), tuple_getitem(lamb_next_mv, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def un_match(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -354,7 +340,6 @@ def test_lamb_next_mv_rule_cond3(tag):
|
|||
mul4 = Mul(input6, constant_mul4_x)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, real_div4)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
|
|
@ -59,8 +59,7 @@ def test_lamb_next_mv_with_decay_rule_cond4(tag):
|
|||
add5 = Add(real_div4, mul4)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -71,8 +70,7 @@ def test_lamb_next_mv_with_decay_rule_cond4(tag):
|
|||
constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv_with_decay, 0), tuple_getitem(lamb_next_mv_with_decay, 1),
|
||||
tuple_getitem(lamb_next_mv_with_decay, 2), tuple_getitem(lamb_next_mv_with_decay, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def before_unmatched_add3(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -96,8 +94,7 @@ def test_lamb_next_mv_with_decay_rule_cond4(tag):
|
|||
add5 = Add(real_div4, mul4)
|
||||
add3 = Mul(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched_mul4(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -121,8 +118,7 @@ def test_lamb_next_mv_with_decay_rule_cond4(tag):
|
|||
add5 = Add(real_div4, mul4)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched_real_div0(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -146,8 +142,7 @@ def test_lamb_next_mv_with_decay_rule_cond4(tag):
|
|||
add5 = Add(real_div4, mul4)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched_real_div1(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x,
|
||||
|
|
@ -171,8 +166,7 @@ def test_lamb_next_mv_with_decay_rule_cond4(tag):
|
|||
add5 = Add(real_div4, mul4)
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -200,8 +194,7 @@ def test_lamb_next_mv_with_decay_rule_cond1(tag):
|
|||
add5 = Add(mul4, real_div4)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -212,8 +205,7 @@ def test_lamb_next_mv_with_decay_rule_cond1(tag):
|
|||
constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv_with_decay, 0), tuple_getitem(lamb_next_mv_with_decay, 1),
|
||||
tuple_getitem(lamb_next_mv_with_decay, 2), tuple_getitem(lamb_next_mv_with_decay, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def un_match(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -237,8 +229,7 @@ def test_lamb_next_mv_with_decay_rule_cond1(tag):
|
|||
# un match
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -266,8 +257,7 @@ def test_lamb_next_mv_with_decay_rule_cond2(tag):
|
|||
add5 = Add(mul4, real_div4)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -278,8 +268,7 @@ def test_lamb_next_mv_with_decay_rule_cond2(tag):
|
|||
constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv_with_decay, 0), tuple_getitem(lamb_next_mv_with_decay, 1),
|
||||
tuple_getitem(lamb_next_mv_with_decay, 2), tuple_getitem(lamb_next_mv_with_decay, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def un_match(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -303,8 +292,7 @@ def test_lamb_next_mv_with_decay_rule_cond2(tag):
|
|||
# un_match
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
||||
|
|
@ -332,8 +320,7 @@ def test_lamb_next_mv_with_decay_rule_cond3(tag):
|
|||
add5 = Add(mul4, real_div4)
|
||||
add3 = Add(mul4, real_div2)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -344,8 +331,7 @@ def test_lamb_next_mv_with_decay_rule_cond3(tag):
|
|||
constant_add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_mv_with_decay, 0), tuple_getitem(lamb_next_mv_with_decay, 1),
|
||||
tuple_getitem(lamb_next_mv_with_decay, 2), tuple_getitem(lamb_next_mv_with_decay, 3))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
@fns
|
||||
def un_match(input0, input1, input2, input3, input4, input5, input6, constant_mul0_x, constant_mul1_sub,
|
||||
|
|
@ -369,7 +355,6 @@ def test_lamb_next_mv_with_decay_rule_cond3(tag):
|
|||
# un match
|
||||
add3 = Add(real_div2, mul4)
|
||||
outputs = make_tuple(add3, add0, add1, add5)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ def test_lamb_next_right_rule(tag):
|
|||
sqrt0 = Sqrt(real_div1)
|
||||
add2 = Add(sqrt0, add2_y)
|
||||
outputs = make_tuple(add1, add2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def before_unmatched(input0, input1, mul2_x, mul3_x, true_div1_recip, add2_y):
|
||||
|
|
@ -62,14 +61,12 @@ def test_lamb_next_right_rule(tag):
|
|||
sqrt0 = Sqrt(real_div1)
|
||||
add2 = Add(sqrt0, add2_y)
|
||||
outputs = make_tuple(add1, add2)
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return output
|
||||
return outputs
|
||||
|
||||
@fns
|
||||
def after(input0, input1, mul2_x, mul3_x, true_div1_recip, add2_y):
|
||||
lamb_next_right = LambNextRight(input0, input1, mul2_x, mul3_x, true_div1_recip, add2_y)
|
||||
outputs = make_tuple(tuple_getitem(lamb_next_right, 0), tuple_getitem(lamb_next_right, 1))
|
||||
output = tuple_getitem(outputs, 0)
|
||||
return make_tuple(output)
|
||||
return make_tuple(outputs)
|
||||
|
||||
return fns[tag]
|
||||
|
|
|
|||
Loading…
Reference in New Issue