Skip to content

Commit

Permalink
fix output size adjustment for onnxifi_op
Browse files Browse the repository at this point in the history
Summary: this breaks if we cut the net at certain int8 ops boundary.

Test Plan: with net_runner to lower a single Int8Quantize op. It used to break. Now it works.

Reviewed By: yinghai

Differential Revision: D22912178

fbshipit-source-id: ca306068c9768df84c1cfa8b34226a1330e19912
  • Loading branch information
tracelogfb authored and facebook-github-bot committed Aug 5, 2020
1 parent 102abb8 commit 5023995
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caffe2/opt/onnxifi_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ int OnnxifiOp<CPUContext>::extractOutputBatchSizes() {
real_shape.dims(j),
")");
begin_ptr[j] = 0;
if (max_shape[j] > real_shape.dims(j)) {
if (max_shape[j] >= real_shape.dims(j)) {
end_ptr[j] = real_shape.dims(j);
mismatch += j;
} else {
Expand Down

0 comments on commit 5023995

Please sign in to comment.