Skip to content

Commit

Permalink
[python] Make module imports relative in fx.py and `compiler_utils.…
Browse files Browse the repository at this point in the history
…py` (#3925)

This PR makes module imports relative in `fx.py` and
`compiler_utils.py`. When torch-mlir python package is embedded into
python package of other MLIR based project, there won't be `torch_mlir`
top level package for absolute import.
  • Loading branch information
shelkesagar29 authored Jan 13, 2025
1 parent 4a2cbb9 commit 11efcda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/torch_mlir/compiler_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from typing import Union, List

import torch
from torch_mlir.passmanager import PassManager
from torch_mlir.ir import StringAttr
from .passmanager import PassManager
from .ir import StringAttr


class TensorPlaceholder:
Expand Down
10 changes: 5 additions & 5 deletions python/torch_mlir/fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import torch.nn as nn
from torch.export import ExportedProgram

from torch_mlir.extras.fx_importer import FxImporter, FxImporterHooks
from torch_mlir import ir
from torch_mlir.dialects import torch as torch_d
from torch_mlir.extras.fx_decomp_util import get_decomposition_table
from torch_mlir.compiler_utils import (
from .extras.fx_importer import FxImporter, FxImporterHooks
from . import ir
from .dialects import torch as torch_d
from .extras.fx_decomp_util import get_decomposition_table
from .compiler_utils import (
OutputType,
run_pipeline_with_repro_report,
lower_mlir_module,
Expand Down

0 comments on commit 11efcda

Please sign in to comment.