Skip to content

Commit

Permalink
Rebasing
Browse files Browse the repository at this point in the history
Change-Id: I7aa12e0217b8a2e1ff2a97a7c5fdda6b7597ae64
  • Loading branch information
Giuseppe Rossini committed Jun 7, 2021
1 parent 6b6083f commit 6075b68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/relay/backend/aot_executor_codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,18 @@ class AOTExecutorCodegen : public ExprVisitor {
continue;
}


auto sid_value = sids_table_[sid];
if (!use_unpacked_api_) {
// Pack the sid inside the TVMValue
auto sid_array = te::Var(MakeString("sid_", sid, "_value"), DataType::Handle());
// Pack the sid inside the TVMValue
auto sid_array = te::Var(MakeString("sid_", sid, "_value"), DataType::Handle());
tvm::PrimExpr set_tensor =
tvm::tir::Call(DataType::Handle(), tvm::tir::builtin::tvm_struct_set(),
{sid_array, 0, tir::builtin::kArrData, sid_value});
stmts_.push_back(
tir::LetStmt(sid_array, StackAlloca("array", 1), tir::Evaluate(set_tensor)));
buffer_vars.push_back(sid_array);
} else {
buffer_vars.push_back(sid_value)
buffer_vars.push_back(sid_value);
}
}
return buffer_vars;
Expand Down
2 changes: 1 addition & 1 deletion tests/python/relay/aot/aot_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def convert_to_relay(
input_data,
input_node,
):
""" Convert a tflite model buffer in a Relay module """
"""Convert a tflite model buffer in a Relay module"""

def convert_to_list(x):
if not isinstance(x, list):
Expand Down
3 changes: 2 additions & 1 deletion tests/python/relay/aot/test_crt_aot.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ def test_quant_mobilenet_tfl():
inputs = {"input": data}
output_list = generate_ref_data(mod, inputs, params)
input_list = [inputs["input"]]
compile_and_run(mod, input_list, output_list, True, params)
compile_and_run(mod, input_list, output_list, "--unpacked-api=0", True, params)


@pytest.mark.parametrize("target_options", ["--unpacked-api=0", "--unpacked-api=1"])
def test_transpose(target_options):
Expand Down

0 comments on commit 6075b68

Please sign in to comment.