MCPcopy Create free account
hub / github.com/tensorflow/tfjs / scheduleModels

Function scheduleModels

e2e/benchmarks/browserstack-benchmark/app.js:444–454  ·  view source on GitHub ↗

* Get the models to benchmark for the day running the script. (All models are * spilted to n buckets and n === period, associated with the date of the month, * and the function returns a certain bucket.) * * @param models The models to schedule. * @param period The period to run all models. *

(models, period, date = new Date().getDate())

Source from the content-addressed store, hash-verified

442 * benchmark. By default, the date would be the date at runtime.
443 */
444function scheduleModels(models, period, date = new Date().getDate()) {
445 if (period < 1 || period > 31) {
446 throw new Error('--period must be an integer of 1~31.');
447 }
448 if (date <= 0 || date > 31) {
449 throw new Error('--date must be an integer of 1~31.');
450 }
451 date = (date - 1) % period;
452 const bucketSize = Math.ceil(models.length / period);
453 return models.slice(date * bucketSize, (date + 1) * bucketSize);
454}
455
456/**
457 * Runs a benchmark with a preconfigured file

Callers 2

runBenchmarkFromFileFunction · 0.85
app_node_test.jsFile · 0.85

Calls 2

ceilMethod · 0.80
sliceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…