Skip to content

Commit

Permalink
[FxImporter] Fix primitive type in return (llvm#3379)
Browse files Browse the repository at this point in the history
  • Loading branch information
penguin-wwy authored May 23, 2024
1 parent 2e194e1 commit d924d00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion projects/pt1/e2e_testing/xfail_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@
"TensorToBool_basic",
"TensorToFloatZeroRank_basic",
"TensorToFloat_basic",
"TestMultipleTensorAndPrimitiveTypesReturn_basic",
"ThresholdBackward2dMixedModule_basic",
"TorchPrimLoopForLikeModule_basic",
"TorchPrimLoopWhileLikeModule_basic",
Expand Down
7 changes: 7 additions & 0 deletions python/torch_mlir/extras/fx_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,13 @@ def _graph_to_function_meta(self, g: Graph) -> Tuple[FunctionType, Location]:
result_types.append(
self._cc.tensor_to_vtensor_type(result_node)
)
elif type(result_node) in SCALAR_TYPE_TO_TORCH_MLIR_TYPE:
result_types.append(
IrType.parse(
SCALAR_TYPE_TO_TORCH_MLIR_TYPE[type(result_node)],
self._c,
)
)
else:
result_types.append(self._cc.node_val_to_type(result_node))
return (
Expand Down

0 comments on commit d924d00

Please sign in to comment.