Custom-built TFLite with WASM – best practices
Hi @AlexanderLutsenko ,

Yes, TFJS supports  WASM when executing TensorFlow Lite models in the browser. You can move with the [link](https://github.com/tensorflow/tfjs/tree/master/tfjs-tflite#tflite-support-for-tensorflowjs) as you menmtioned and can build the `tfjs-tflite` using `yarn build` which inturn uses `bazel` with wasm backend.

- Navigate to `tfjs-tflite repo`
- Check for `yarn` installation
- Run `yarn build`
- 
I tried with Bazel 6.1.0 but build was not successsful but tested with Bazel 5.3.0, the yarn build is successful. Please check this [gist](https://colab.research.google.com/gist/LakshmiKalaKadali/42c828b624b00a4b28615dc0d7865d83/tflite_62863.ipynb) provided with the tfjs-tflite build.
 Please refer other useful links  [link1](https://github.com/emscripten-core/emsdk/tree/master/bazel#bazel-emscripten-toolchain), [link2](https://github.com/tensorflow/tensorflow/issues/46359#issuecomment-1215595828).

Thank You This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62863">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62863">No</a>

### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.15

### Custom code

Yes

### OS platform and distribution

Linux Ubuntu 20.04

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

6.5.0

### GCC/compiler version

13.1.0

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Hello, folks! I want to make a custom build of TFLite for the web, but not sure how to approach it.

Specifically, there are two things I'd like to add

1. The ability to write model inputs directly to memory and read outputs from memory. This improves performance quite substantially.

```python
EMSCRIPTEN_KEEPALIVE
float* getInputMemoryOffset(int i) {
	return interpreter->typed_input_tensor<float>(i);
}

EMSCRIPTEN_KEEPALIVE
float* getOutputMemoryOffset(int i) {
	return interpreter->typed_output_tensor<float>(i);
}
```

2. Support for custom ops (e.g. from Mediapipe) which are not present in the standard build

```python
tflite::ops::builtin::BuiltinOpResolver resolver;
resolver.AddCustom("Convolution2DTransposeBias", mediapipe::tflite_operations::RegisterConvolution2DTransposeBias());
tflite::InterpreterBuilder builder(*model, resolver);
```

[Here](https://github.com/tensorflow/tensorflow/issues/61200) is one approach that used to work some time ago (I believe around v2.3), bit it does not anymore.

Then I read [this](https://github.com/tensorflow/tfjs/tree/master/tfjs-tflite#tflite-support-for-tensorflowjs), and it says in TFJS, WASM is supported out of the box. Should I perhaps go that way? If so, how?

To summarize:
Should I use bazel or cmake? Plain TFLite or TFJS? Is it necessary to write a custom emscripten build recipe or the standard ones will do?


### Standalone code to reproduce the issue

```shell
N/A
```


### Relevant log output

_No response_