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

Function profileModelInference

e2e/benchmarks/benchmark_util.js:429–432  ·  view source on GitHub ↗

* Executes the predict function for `model` (`model.predict` for * tf.LayersModel and `model.executeAsync` for tf.GraphModel) and returns a * promise that resolves with information about the memory usage: * - `newBytes`: the number of new bytes allocated. * - `newTensors`: the number of new tens

(model, input, numProfiles = 1)

Source from the content-addressed store, hash-verified

427 * @param numProfiles The number of rounds for profiling the inference process.
428 */
429async function profileModelInference(model, input, numProfiles = 1) {
430 const predict = getPredictFnForModel(model, input);
431 return profileInference(predict, false, numProfiles);
432}
433
434/**
435 * Executes `predict()` and returns a promise that resolves with information

Callers 1

benchmarkModelFunction · 0.85

Calls 2

getPredictFnForModelFunction · 0.85
profileInferenceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…