pytorch
82006ba4 - [PyTorch Edge] Implement fb::jpeg_decode_to_NCHW (#55251)

Commit
3 years ago
[PyTorch Edge] Implement fb::jpeg_decode_to_NCHW (#55251) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55251 Based on a discussion with dreiss and JacobSzwejbka, we decided to implement a flexible operator for decoding a JPEG bundled image that allows getting the image in BGR format with scaling, and offsets applied for the MaskRCNN operators without calling `conv2d()` and pulling in a ton of additional operators and kernel functions. Please see the previous diff in the stack for the new operators that the change w/o this diff would have pulled in since Inflatable Arg string is non-trivial. This change implements that operator. Please see the comments in the code for detail regarding what the operator does. ghstack-source-id: 125641068 Test Plan: I re-implemented the existing operator in terms of the new operator and used the existing unit test to ensure that the same (or comparable) tensor is produced. ``` cd fbsource/fbcode/ buck test caffe2/test:test_bundled_images ``` Ran this bento notebook https://www.internalfb.com/intern/anp/view/?id=476100 with the new operator `fb::jpeg_decode_to_NCHW` and saw that it is able to generate proposals. Ran the generated hand tracking model with tracer and observed just the 2 new operators and 0 new dtypes copy kernel function, which to me seems like an acceptable set of new ops to pull in since they are relatively simple operators: {P383858691} Reviewed By: dreiss Differential Revision: D27531423 fbshipit-source-id: 2dc6c41029236bb71922e51cbfd14a46c5651149
Author
Parents
Loading