Skip to content

Commit 171eeed

Browse files
committed
fix aoti model generation output types
1 parent b07cd11 commit 171eeed

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

qa/common/gen_qa_models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,6 +1389,9 @@ def create_torch_aoti_modelfile(
13891389
):
13901390
return
13911391

1392+
torch_output0_dtype = np_to_torch_dtype(output0_dtype)
1393+
torch_output1_dtype = np_to_torch_dtype(output1_dtype)
1394+
13921395
model_name = tu.get_model_name(
13931396
"torch_aoti",
13941397
input_dtype,
@@ -1415,7 +1418,7 @@ def __init__(self, swap):
14151418
def forward(self, INPUT0, INPUT1):
14161419
op0 = (INPUT0 - INPUT1) if self.swap else (INPUT0 + INPUT1)
14171420
op1 = (INPUT0 + INPUT1) if self.swap else (INPUT0 - INPUT1)
1418-
return op0, op1
1421+
return op0.to(self.output0_dtype), op1.to(self.output1_dtype)
14191422

14201423
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
14211424
model = AddSubNet(swap)

0 commit comments

Comments
 (0)