Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change import path
Signed-off-by: xin3he <[email protected]>
  • Loading branch information
xin3he committed Jun 12, 2024
commit 03c112442bd48f851a3ed1d62017ded9d309a994
2 changes: 2 additions & 0 deletions neural_compressor/experimental/export/qlinear2qdq.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pragma: no cover
"""Helper functions to export onnx model from QLinearops to QDQ."""
from deprecated import deprecated

Expand Down
2 changes: 2 additions & 0 deletions neural_compressor/experimental/export/tf2onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pragma: no cover
"""Helper functions to export model from TensorFlow to ONNX."""

import re
Expand Down
2 changes: 2 additions & 0 deletions neural_compressor/experimental/export/torch2onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# pragma: no cover
"""Helper functions to export model from PyTorch/TensorFlow to ONNX."""

import os
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/model/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ def find_ffn_matmul(self, attention_index, attention_matmul_list, block_len):
def export(self, save_path, conf):
"""Export Qlinear to QDQ model."""
from neural_compressor.config import ONNXQlinear2QDQConfig
from neural_compressor.experimental.export import onnx_qlinear_to_qdq
from neural_compressor.utils.export import onnx_qlinear_to_qdq

if isinstance(conf, ONNXQlinear2QDQConfig):
add_nodes, remove_nodes, inits = onnx_qlinear_to_qdq(self._model, self._input_name_to_nodes)
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/model/tensorflow_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ def export(self, save_path, conf):
+ "we reset opset_version={} here".format(conf.opset_version)
)

from neural_compressor.experimental.export import tf_to_fp32_onnx, tf_to_int8_onnx
from neural_compressor.utils.export import tf_to_fp32_onnx, tf_to_int8_onnx

inputs_as_nchw = conf.kwargs.get("inputs_as_nchw", None)
if conf.dtype == "int8":
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/model/torch_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def export(
"but the torch version found is {}".format(Version("1.12.0"), version)
)

from neural_compressor.experimental.export import torch_to_fp32_onnx, torch_to_int8_onnx
from neural_compressor.utils.export import torch_to_fp32_onnx, torch_to_int8_onnx

if conf.dtype == "int8":
torch_to_int8_onnx(
Expand Down
2 changes: 1 addition & 1 deletion neural_compressor/onnxrt/utils/onnx_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ def find_ffn_matmul(self, attention_index, attention_matmul_list, block_len):
def export(self, save_path, conf):
"""Export Qlinear to QDQ model."""
from neural_compressor.config import ONNXQlinear2QDQConfig
from neural_compressor.experimental.export import onnx_qlinear_to_qdq
from neural_compressor.utils.export import onnx_qlinear_to_qdq

if isinstance(conf, ONNXQlinear2QDQConfig):
if len(self._input_name_to_nodes) == 0:
Expand Down
Loading