[mlir][python] Make a number of imports relative.

Avoiding absolute imports allows the code to be relocatable (which is used for out of tree integrations).

Differential Revision: https://reviews.llvm.org/D107617
This commit is contained in:
Stella Laurenzo 2021-08-06 04:10:03 +00:00
parent 2d9af3db79
commit 835cbfa8cf
5 changed files with 8 additions and 10 deletions

View File

@ -53,7 +53,7 @@ Referencing a named symbol:
from typing import Callable, Dict, Optional, Tuple, Union
from mlir import ir as _ir
from ..... import ir as _ir
__all__ = [
"AffineBuildState",

View File

@ -11,8 +11,7 @@ represent actual op definitions (i.e. YAML).
from typing import Any, Dict, List, Optional, Sequence, Set, Tuple
from enum import Enum
from mlir import ir as _ir
from ..... import ir as _ir
from .affine import *
from .scalar_expr import *
from .types import *

View File

@ -13,8 +13,7 @@ to helpers on the comprehension objects themselves.
from typing import Dict, Optional
from mlir import ir as _ir
from ..... import ir as _ir
from .comprehension import *
from .yaml_helper import *

View File

@ -9,7 +9,7 @@ import functools
import inspect
import threading
from mlir import ir
from ..... import ir
from .comprehension import *
from .config import *
from .emitter import *

View File

@ -4,10 +4,10 @@
from typing import Dict, Sequence
from mlir.ir import *
from mlir.dialects import linalg
from mlir.dialects import std
from mlir.dialects import math
from .....ir import *
from .... import linalg
from .... import std
from .... import math
# TODO: resolve name collision for Linalg functionality that is injected inside
# the _mlir.dialects.linalg directly via pybind.
from ....._cext_loader import _cext