SIGN IN SIGN UP

Bugfixes to enable call_map. (#4471)

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

1. Allocate memory for call_map input.
    call_map uses `select_copy` to extract the input tensor from the original mapped input for each iteration. We would need to memory-plan this tensor. The newly added test `test_run_emit_map` would fail when the input tensor is not memory-planned.

2. Avoid resize inside `et_copy_index` operator when copy_to tensor is already large enough. This avoids the following error:

```
test_run_emit_map (executorch.exir.emit.test.test_emit.TestEmit) ... E 00:00:08.249223 executorch:tensor_impl.cpp:93] Attempted to resize a static tensor to a new shape at dimension 0 old_size: 4 new_size: 1
F 00:00:08.249282 executorch:et_copy_index.cpp:101] In function et_copy_index(), assert failed: err == Error::Ok
```

Reviewed By: tarun292

Differential Revision: D60468979

fbshipit-source-id: da4e9ebe09c065004b7bd0247f7420ff08aa955b
H
Hardik Sharma committed
a86204cf3de543c2602740642ab0d9ddcbe34298
Parent: 5636c9c
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 8/5/2024, 9:42:15 PM