MCPcopy
hub / github.com/justadudewhohacks/face-api.js / expectAllTensorsReleased

Function expectAllTensorsReleased

test/utils.ts:27–31  ·  view source on GitHub ↗
(fn: () => any)

Source from the content-addressed store, hash-verified

25}
26
27export async function expectAllTensorsReleased(fn: () => any) {
28 const numTensorsBefore = tf.memory().numTensors
29 await fn()
30 expect(tf.memory().numTensors - numTensorsBefore).toEqual(0)
31}
32
33export function pointDistance(pt1: IPoint, pt2: IPoint) {
34 return Math.sqrt(Math.pow(pt1.x - pt2.x, 2) + Math.pow(pt1.y - pt2.y, 2))

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…