MCPcopy
hub / github.com/tensorflow/tfjs / checkFraction

Function checkFraction

tfjs-core/src/io/progress.ts:56–70  ·  view source on GitHub ↗
(startFraction: number, endFraction: number)

Source from the content-addressed store, hash-verified

54 }
55
56 function checkFraction(startFraction: number, endFraction: number): void {
57 assert(
58 startFraction >= 0 && startFraction <= 1,
59 () => `Progress fraction must be in range [0, 1], but ` +
60 `got startFraction ${startFraction}`);
61 assert(
62 endFraction >= 0 && endFraction <= 1,
63 () => `Progress fraction must be in range [0, 1], but ` +
64 `got endFraction ${endFraction}`);
65 assert(
66 endFraction >= startFraction,
67 () => `startFraction must be no more than endFraction, but ` +
68 `got startFraction ${startFraction} and endFraction ` +
69 `${endFraction}`);
70 }
71
72 return Promise.all(promises.map(registerMonitor));
73}

Callers 1

monitorPromisesProgressFunction · 0.85

Calls 1

assertFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…