intel / webml-polyfill

Deprecated, the Web Neural Network Polyfill project has been moved to https://github.com/webmachinelearning/webnn-polyfill
Apache License 2.0
161 stars 46 forks source link

CUSTOM operator #1085

Open MAkcanca opened 4 years ago

MAkcanca commented 4 years ago

Operator code is 32 from TFLite. kTfLiteBuiltinCustom / tflite.BuiltinOperator.CUSTOM I couldn't find any equivalent operator in WASM, webml-polyfill. Does it exist or should I create a PR?🌟

huningxin commented 4 years ago

The polyfill doesn't intend to support kTfLiteBuiltinCustom. The solution would be implementing the custom operator in user's WASM code. Or check whether TFLite supports WASM.

MAkcanca commented 4 years ago

WASM or WEBGL, CUSTOM operator is a crucial part of most modern neural networks. Although I understand your concerns, I still need guidance on how to implement this on webml-polyfill. Any suggestions?

huningxin commented 4 years ago

For WebGL, we map webml-polyfill ops to TF.js ops.

For WASM, we compile TFLite C++ implementation to WASM, expose them to JS, e.g. conv2d and map webml-polyfill ops to TFLite ops.