Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfeiBai committed Apr 10, 2024
1 parent c1c86cd commit bb598d9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions test/test_fori_loop_simple_linear_model_test_code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import os
# import unittest
# from typing import Callable, Dict, List

import torch
import torch_xla
Expand All @@ -17,15 +15,13 @@
device = xm.xla_device()

# --- linear one ---
# l_in = torch.randn(10, device=xm.xla_device())
# linear = torch.nn.Linear(10, 20).to(xm.xla_device())
# l_out = linear(l_in)
# print("linear one: ", l_out)
l_in = torch.randn(10, device=xm.xla_device())
linear = torch.nn.Linear(10, 20).to(xm.xla_device())
l_out = linear(l_in)
print("linear one: ", l_out)

# --- while test case ---

# lower = torch.tensor([2], dtype=torch.int32, device=device)
# upper = torch.tensor([52], dtype=torch.int32, device=device)
upper = torch.tensor([52], dtype=torch.int32, device=device)
lower = torch.tensor([2], dtype=torch.int32, device=device)
one_value = torch.tensor([1], dtype=torch.int32, device=device)
Expand Down

0 comments on commit bb598d9

Please sign in to comment.