SIGN IN SIGN UP

Fail when trying to resize DYNAMIC_UNBOUND tensors past their capacity (#1610)

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

We don't yet support arbitrary resizing of DYNAMIC_UNBOUND tensors in lean mode. Make sure we check for this case, otherwise the resize operation will appear to succeed, and callers can overrun the buffer.

While I was working on this the linter yelled at me about `set_sizes_contiguous()` being deprecated, so also update `tensor_impl_test.cpp` to use the non-deprecated `resize_tensor_impl()`, which has the extra benefit of not failing fatally.

Reviewed By: JacobSzwejbka

Differential Revision: D52809543

fbshipit-source-id: 2732f8fda841f343e800ccf021881a44bd717c5d
D
Dave Bort committed
bd024e593b260084703a31664bc1fe0aca8887ad
Parent: 94ef5de
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 1/17/2024, 11:17:27 PM