webnn: Support block-wise quantize/dequantize Block-wise expands the scale and zero point for both TFLite quantized tensor and emulated implementation. For quantized tensor, resize the constant data to match input shape. For emulated implementation, TFLite resize_nearest_neighbor[1] kernel only support 2d, so the decomposition [2] is used that expands each axis by repeating below steps: 1, Compute the flattened shape before and after the given axis. 2, Resize the dimension of axis using nearest neighbor resampling. 3, Reshape back to input dimensions by block_size dimension. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/tflite/src/tensorflow/lite/kernels/resize_nearest_neighbor.cc;drc=c7f54c35c6e6a69fd778bd212d9c29431a8e48e3;l=76 [2] https://www.w3.org/TR/webnn/#api-mlgraphbuilder-dequantizelinear Bug: 377172670 Change-Id: I97fd40ef1eeeb63b9b9a62142b2f839bbe750a8f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6841515 Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: ningxin hu <ningxin.hu@intel.com> Commit-Queue: Junwei Fu <junwei.fu@intel.com> Cr-Commit-Position: refs/heads/main@{#1502528}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.