Skip to content

Commit

Permalink
bug fix for topi conv2d test with multiplication (apache#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoreau89 committed Mar 20, 2019
1 parent e7be16a commit 1c8a0aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion vta/config/vta_config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"TARGET" : "pynq",
"TARGET" : "sim",
"HW_VER" : "0.0.2",
"HW_FREQ" : 100,
"HW_CLK_TARGET" : 7,
Expand Down
5 changes: 5 additions & 0 deletions vta/src/sim/sim_driver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,11 @@ class Device {
return std::min(x, y);
});
}
case VTA_ALU_OPCODE_MUL: {
return RunALULoop<use_imm>(op, [](int32_t x, int32_t y) {
return x * y;
});
}
case VTA_ALU_OPCODE_SHR: {
return RunALULoop<use_imm>(op, [](int32_t x, int32_t y) {
if (y >= 0) {
Expand Down
1 change: 1 addition & 0 deletions vta/tests/python/integration/test_benchmark_topi_conv2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def run_vta_conv2d(env, remote, key, batch_size, wl, profile=True):
res = topi.add(res, bias)
res = topi.multiply(res, coeff)
res = my_clip(res, 0, (1 << env.OUT_WIDTH-1)-1)
res = topi.cast(res, "int8")

# Handle quantized outputs (less than 8 bits)
# o_pack_factor = 1 << (3 - env.LOG_OUT_WIDTH)
Expand Down

0 comments on commit 1c8a0aa

Please sign in to comment.