diff --git a/hpvm/projects/onnx_frontend/frontend/codegen_hpvm.py b/hpvm/projects/onnx_frontend/frontend/codegen_hpvm.py index cd9eac233071787baa6a1224ebb00b2eae837a1b..1a130fc30bec685ee7c903beb35494e939ed25d3 100644 --- a/hpvm/projects/onnx_frontend/frontend/codegen_hpvm.py +++ b/hpvm/projects/onnx_frontend/frontend/codegen_hpvm.py @@ -4,8 +4,8 @@ from typing import Dict, List, Tuple, Union import jinja2 -from graph_builder import DFG -from graph_ir import DFGNode, TensorNode, WeightTensor +from .graph_builder import DFG +from .graph_ir import DFGNode, TensorNode, WeightTensor TEMPLATE_FILE = "template_hpvm.cpp" loader = jinja2.FileSystemLoader(searchpath=Path(__file__).parent) diff --git a/hpvm/projects/onnx_frontend/frontend/codegen_tensor.py b/hpvm/projects/onnx_frontend/frontend/codegen_tensor.py index f0a73106054c41f1bbfcf6692a6e8398fd4de3b4..c4660b24bad43c3ed8928248a17211e1ee291da9 100644 --- a/hpvm/projects/onnx_frontend/frontend/codegen_tensor.py +++ b/hpvm/projects/onnx_frontend/frontend/codegen_tensor.py @@ -3,8 +3,8 @@ from typing import Dict, List import jinja2 -from codegen_hpvm import CodeGen -from graph_ir import DFGNode, TensorNode +from .codegen_hpvm import CodeGen +from .graph_ir import DFGNode, TensorNode TEMPLATE_FILE = "template_tensor.cpp" loader = jinja2.FileSystemLoader(searchpath=Path(__file__).parent) diff --git a/hpvm/projects/onnx_frontend/frontend/graph_builder.py b/hpvm/projects/onnx_frontend/frontend/graph_builder.py index 3996b947d2e51b0eea515bdacf2ed1bb625e35ad..e8bf86a84acce61fb7c9170ddd936632c068f529 100644 --- a/hpvm/projects/onnx_frontend/frontend/graph_builder.py +++ b/hpvm/projects/onnx_frontend/frontend/graph_builder.py @@ -6,8 +6,8 @@ from typing import Dict, Iterable, List, Optional, Tuple, Union import networkx as nx import onnx -import graph_ir as g -from onnx_attr import node_attr_to_dict +from . import graph_ir as g +from .onnx_attr import node_attr_to_dict GraphT = onnx.GraphProto NodeT = onnx.NodeProto diff --git a/hpvm/projects/onnx_frontend/frontend/graph_ir.py b/hpvm/projects/onnx_frontend/frontend/graph_ir.py index fd42617f600e8ec8e6c9012fbd3adfa56ada76ec..f567ddafed3f1e5fa1bc0d39ce3ac995f1b63b55 100644 --- a/hpvm/projects/onnx_frontend/frontend/graph_ir.py +++ b/hpvm/projects/onnx_frontend/frontend/graph_ir.py @@ -4,7 +4,7 @@ from typing import List, Tuple import onnx -from onnx_attr import node_attr_to_dict +from .onnx_attr import node_attr_to_dict class DFGNode(abc.ABC): diff --git a/hpvm/projects/onnx_frontend/frontend/main.py b/hpvm/projects/onnx_frontend/main.py similarity index 95% rename from hpvm/projects/onnx_frontend/frontend/main.py rename to hpvm/projects/onnx_frontend/main.py index d3037224ac6a44535eabc8cf9f8e96ecf48021c9..07b5bb724915480d4f6bc04110f808da0254e0bb 100644 --- a/hpvm/projects/onnx_frontend/frontend/main.py +++ b/hpvm/projects/onnx_frontend/main.py @@ -32,9 +32,9 @@ def compile( opset: Optional[int], hpvmc: bool, ): - from graph_builder import DFG - from codegen_tensor import TensorCodeGen - from codegen_hpvm import HpvmCodeGen + from frontend.graph_builder import DFG + from frontend.codegen_tensor import TensorCodeGen + from frontend.codegen_hpvm import HpvmCodeGen model = onnx.load(onnx_file) if opset is not None: