From 6def9c4da9232f87c7aba135a2402c62ab4f5484 Mon Sep 17 00:00:00 2001 From: manfeibaigithub Date: Wed, 10 Apr 2024 20:57:00 +0000 Subject: [PATCH] test --- test/test_fori_loop_simple_linear_model_test_code.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/test_fori_loop_simple_linear_model_test_code.py b/test/test_fori_loop_simple_linear_model_test_code.py index 285a6e0f37e..3fa988ded84 100644 --- a/test/test_fori_loop_simple_linear_model_test_code.py +++ b/test/test_fori_loop_simple_linear_model_test_code.py @@ -60,8 +60,8 @@ def body_fun(l_in_i): # TODO(@manfei), need to create new variable to seperate old/formal HLO/IR l_in_0 = torch.randn(10, device=xm.xla_device()) -print("body_fun.weight: ", body_fun.weight) -print("body_fun.weight_: ", body_fun.weight_) +# print("body_fun.weight: ", body_fun.weight) +# print("body_fun.weight_: ", body_fun.weight_) # def body_fun(x, y, l_in): # # l_in = torch.randn(10, device=xm.xla_device()) # linear = torch.nn.Linear(10, 20).to(xm.xla_device()) @@ -70,7 +70,7 @@ def body_fun(l_in_i): # placeholder_func = torch.rand(size = l_out.size(), device = device) # placeholder_input = torch.rand(size = l_in_i.size(), device = device) -print("test code, body_fun: ", body_fun) +# print("test code, body_fun: ", body_fun) # out: # (upper, lower, !!!one_value, !!!torch.add_res, l_out, weight, final_one) @@ -80,7 +80,8 @@ def body_fun(l_in_i): # one_value_, upper_, lower_, add_res_x_, bias_, weight_, l_in_i_plus_1_, l_out_= fori_loop(upper, lower, body_fun, one_value, init_val, l_in_0) # , placeholder_func, placeholder_input) # , linear_0, l_in_0) weight_0 =linear_0.weight bias_0 = linear_0.bias -one_value_, lower_, upper_, add_res_x_, bias_, weight_, l_in_i_plus_1_, l_out_= fori_loop(one_value, lower, upper, body_fun, init_val, l_in_0, weight_0=weight_0, bias_0=bias_0) # , placeholder_func, placeholder_input) # , linear_0, l_in_0) +# one_value_, lower_, upper_, add_res_x_, bias_, weight_, l_in_i_plus_1_, l_out_= fori_loop(one_value, lower, upper, body_fun, init_val, l_in_0, weight_0=weight_0, bias_0=bias_0) # , placeholder_func, placeholder_input) # , linear_0, l_in_0) +one_value_, lower_, upper_, add_res_x_, bias_, weight_, l_in_i_plus_1_, l_out_= fori_loop(one_value, lower, upper, linear_0, init_val, l_in_0, weight_0=weight_0, bias_0=bias_0) # , placeholder_func, placeholder_input) # , linear_0, l_in_0) #one_value, [upper],[lower],x, [bias],[new_weight], [l_in_i+1], l_out print("one_value_: ", one_value_)