Skip to content

Commit

Permalink
Fix the bug for truncated model (#372)
Browse files Browse the repository at this point in the history
Find the bug when debug
#371.
  • Loading branch information
AmosLewis authored Oct 16, 2024
1 parent 27e98e2 commit ca23af4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion alt_e2eshark/e2e_testing/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def get_shape_string(torch_tensor):
dtype = torch_tensor.dtype
if dtype == torch.int64:
input_shape_string += "xi64"
if dtype == torch.int32:
input_shape_string += "xi32"
elif dtype == torch.float32 or dtype == torch.float:
input_shape_string += "xf32"
elif dtype == torch.bfloat16 or dtype == torch.float16 or dtype == torch.int16:
Expand Down Expand Up @@ -142,7 +144,9 @@ class TestTensors:

def __init__(self, data: Tuple):
self.data = data
self.type = type(self.data[0])
self.type = None
if len(data) > 0 :
self.type = type(self.data[0])
if not all([type(d) == self.type for d in data]):
self.type == None

Expand Down
1 change: 1 addition & 0 deletions alt_e2eshark/onnx_tests/helper_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(self, og_model_info_class: type, og_name: str, *args, **kwargs):
run_dir = Path(self.model).parents[1]
og_model_path = os.path.join(run_dir, og_name)
self.sibling_inst = og_model_info_class(og_name, og_model_path)
self.opset_version = self.sibling_inst.opset_version

def construct_model(self):
if not os.path.exists(self.sibling_inst.model):
Expand Down

0 comments on commit ca23af4

Please sign in to comment.