Skip to content

Commit

Permalink
Some imports were failing from composite_target
Browse files Browse the repository at this point in the history
Change-Id: Ie4c6f27318978d69aec9131d79f9a3f28c99f3b0
  • Loading branch information
ashutosh-arm committed Nov 16, 2021
1 parent cdebe57 commit 1782b14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/tvm/micro/model_library_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from .._ffi import get_global_func
from ..contrib import utils
from ..driver import build_module
from ..driver.tvmc.composite_target import get_codegen_names
from ..runtime import ndarray as _nd
from ..relay.backend import executor_factory
from ..relay.backend.name_transforms import to_c_variable_style, prefix_generated_name
Expand Down Expand Up @@ -175,7 +174,8 @@ def _build_function_memory_map(function_metadata):
device_max_workspace = dict()
main_func_metadata = function_metadata[MAIN_FUNC_NAME_STR]
num_targets = len(main_func_metadata.workspace_sizes.items())
external_codegens = get_codegen_names()
from tvm.driver import tvmc
external_codegens = tvmc.composite_target.get_codegen_names()
func_entries = []
target_local_entries = dict()
for i in range(num_targets):
Expand Down
7 changes: 4 additions & 3 deletions tests/python/contrib/test_cmsisnn/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def test_cnn_small():
tflite_model_buf = f.read()

input_shape = (1, 490)
in_min, in_max = get_range_for_dtype_str("int8")
input_data = np.random.randint(in_min, high=in_max, size=input_shape).astype(np.float32)
rng = np.random.default_rng(12345)
input_data = rng.random(input_shape, dtype=np.float32)

orig_mod, params = convert_to_relay(tflite_model_buf, input_data, "input")
cmsisnn_mod = cmsisnn.partition_for_cmsisnn(orig_mod, params)
Expand All @@ -101,7 +101,8 @@ def test_cnn_small():
params = {}
output_list = generate_ref_data(orig_mod["main"], inputs, params)
compile_and_run(
AOTTestModel(module=cmsisnn_mod, inputs=inputs, outputs=output_list, params=params),
AOTTestModel(module=cmsisnn_mod, inputs=inputs, outputs=output_list, params=params,
output_tolerance=1),
test_runner,
interface_api,
use_unpacked_api,
Expand Down

0 comments on commit 1782b14

Please sign in to comment.