webnn: Collect input/output tensor indices during build
This change constructs a mapping between tensor names and the index
TFLite uses to refer to the tensor at build time rather than looking it
up during inference. This avoids a bug where NUL characters in a tensor
name are incompatible with the fact that TFLite uses NUL-terminated C
strings in its API.
A new validation test is added to check that such a graph can be
built and executed.
Change-Id: I3959e6602d64ad756c8da069413c65fcbb75f085
Fixed: 380146879
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6043809
Reviewed-by: Phillis Tang phillis@chromium.org
Commit-Queue: Reilly Grant reillyg@chromium.org
Auto-Submit: Reilly Grant reillyg@chromium.org
Cr-Commit-Position: refs/heads/main@{#1388016}