MCPcopy Index your code
hub / github.com/tensorflow/tfjs / commonMobileNetPredictFunc

Function commonMobileNetPredictFunc

e2e/benchmarks/model_config.js:82–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80
81// Common predict function for MobileNetV3 and MobileNetV2Lite
82function commonMobileNetPredictFunc() {
83 const input = tf.randomNormal([1, 224, 224, 3]);
84 const inputData = input.dataSync();
85 if (typeof isTflite === 'function' && isTflite()) {
86 return async () => {
87 // Do copy from 'inputData' in each predict as its buffer
88 // will be detached after transferring to worker.
89 const input = inputData.slice(0);
90 return await tfliteModel.predict(
91 Comlink.transfer(input, [input.buffer]));
92 };
93 } else {
94 return predictFunction(input);
95 }
96}
97
98const benchmarks = {
99 'MobileNetV3': {

Callers

nothing calls this directly

Calls 4

predictFunctionFunction · 0.85
dataSyncMethod · 0.65
sliceMethod · 0.65
predictMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…