onnxruntime
b10fa545 - [React Native] Fix float16 tensor crash by mapping to Uint16Array (#27549)

Commit
106 days ago
[React Native] Fix float16 tensor crash by mapping to Uint16Array (#27549) ### Description Fixes float16 tensor support in the React Native binding by mapping `ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16` to `Uint16Array` instead of `Float16Array`. [Hermes does not support `Float16Array`](https://github.com/facebook/hermes/blob/main/include/hermes/VM/TypedArrays.def). When the binding tries to construct a `Float16Array` via the JSI global lookup, it gets `undefined` and crashes. This is the React Native equivalent of #27327 (the Node.js fix for the same issue, merged Feb 2026). ### Motivation Any React Native app using Hermes (the default since RN 0.70) using a model with float16 inputs/outputs crashes at runtime on both iOS and Android. ### Changes - `js/react_native/cpp/TensorUtils.cpp`: Change `"Float16Array"` to `"Uint16Array"` in `dataTypeToTypedArrayMap` Resolves #27548
Author
Parents
Loading