pytorch/modules
Hao Lu af107c4d16 Fix shape inference bug (#9199)
Summary:
Closes https://github.com/pytorch/pytorch/pull/9199

The input shapes are not logged correctly in production because `PerfNetObserver::Stop()` only gets called after the inference is done for the net and in the mobile models, it's common practice to reuse the blobs as much as possible to save memory. And the shapes of the blobs keep changing during inference. By the time you you query `InputTensorShapes()` in `PerfNetObserver::Stop()`, you only get the final shape of the blobs.

To fix this bug, I moved the 'InputTensorShapes()' query from `PerfNetObserver::Stop()` to `PerfOperatorObserver::Stop()`. The latter gets called at the end of operator->run() whereas `PerfNetObserver::Stop()` gets called at the end of net->run().

Also remove `PerfOperatorObserver::getAnalyticalCost()` since it's now done on the server side and no longer needed on mobile

Reviewed By: Maratyszcza

Differential Revision: D8743346

fbshipit-source-id: 5d2d0132e3f5e084be7d0173863e695e62a6b4a0
2018-07-06 15:15:17 -07:00
..
detectron Add affine_channel_op (#8356) 2018-06-11 20:51:11 -07:00
module_test Caffe2 module update: move observers as well as binaries. (#2145) 2018-03-06 14:45:21 -08:00
observers Fix shape inference bug (#9199) 2018-07-06 15:15:17 -07:00
rocksdb Add missing #include for CAFFE2_MODULE macro. (#6790) 2018-04-19 20:46:09 -07:00
CMakeLists.txt [Caffe2] Add support to TensorRT (#6150) 2018-04-11 17:03:54 -07:00