unit test with multiple op invocations (#19118)
authorJongsoo Park <jongsoo@fb.com>
Mon, 15 Apr 2019 21:35:25 +0000 (14:35 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 15 Apr 2019 21:41:28 +0000 (14:41 -0700)
commitffc9e29844207f4befe548d79fcf18b46f2142e9
treed71ddd77f100f6603ee7cb52cc26b2325d017851
parent00148825fc35ddada2cfc59a30d904e0d8cace7c
unit test with multiple op invocations (#19118)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19118

A bug introduced by D14700576 reported by Yufei (fixed by D14778810 and D14785256) was not detected by our units tests.
This diff improves unit tests to catch such errors (with this diff and without D14778810, we can reproduce the bug Yufei reported).
This improvement also revealed a bug that affects the accuracy when we pre-pack weight and bias together and the pre-packed weight/bias are used by multiple nets. We were modifying the pre-packed bias in-place which was supposed to be constants.

Reviewed By: csummersea

Differential Revision: D14806077

fbshipit-source-id: aa9049c74b6ea98d21fbd097de306447a662a46d
caffe2/quantization/server/conv_depthwise_dnnlowp_op_test.py
caffe2/quantization/server/conv_dnnlowp_acc16_op_test.py
caffe2/quantization/server/conv_dnnlowp_op.cc
caffe2/quantization/server/conv_dnnlowp_op_test.py
caffe2/quantization/server/conv_groupwise_dnnlowp_acc16_op_test.py
caffe2/quantization/server/conv_groupwise_dnnlowp_op_test.py
caffe2/quantization/server/dnnlowp_test_utils.py
caffe2/quantization/server/fully_connected_dnnlowp_acc16_op_test.py
caffe2/quantization/server/fully_connected_dnnlowp_op.cc
caffe2/quantization/server/fully_connected_dnnlowp_op_test.py
caffe2/quantization/server/fully_connected_rowwise_dnnlowp_op_test.py