pytorch
5cf32c1d - Fix Nnapi backend execute's dangling pointer (#63092)

Commit
3 years ago
Fix Nnapi backend execute's dangling pointer (#63092) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63092 Bug discovered while testing NNAPI Delegate on SparkAR. Using ``` c10::IntArrayRef order = {0, 2, 3, 1}; fixed_inputs.push_back(tensorInp.get(i).permute(order).contiguous()); ``` results in a garbage value for order in `permute()`. Moving order inside the call to `permute()` fixes this issue. Problem is seemingly related to https://github.com/pytorch/pytorch/issues/44409, but luckily the solution in this case is simple. Bug wasn't caught earlier, since regular unit tests weren't affected by the dangling pointer, and address sanitizer NNAPI tests are turned off due to there being a different failure (T95764916). ghstack-source-id: 135526129 Test Plan: Run Unit tests: `python test/test_jit.py` Build and run SparkAR on an Android phone at the top of this diff stack (D30173959): `buck build --show-output arstudioplayer_arm64_debug -c pt.enable_nnapi=1` Reviewed By: raziel, iseeyuan Differential Revision: D30237504 fbshipit-source-id: c946d81feefc453b43d9295d8d6f509cafdcec03
Author
Parents
Loading