{"ScriptPreparationCode":"globalThis.backendName_testing = undefined;\r\nglobalThis.jsPerf_Module = undefined;\r\nglobalThis.testCorrectnessIterator = undefined;\r\n\r\nasync function init( backendName ) {\r\n if ( !globalThis.jsPerf_Module ) {\r\n console.log( \u0022import jsPerf_ImageScaling...\u0022 );\r\n globalThis.jsPerf_Module = await import(\r\n \u0022https://cdn.jsdelivr.net/gh/colorfulcakechen/query-submit-canvas@50c1b285ff7c7f8c656c388365b4043528642d6b/CNN/jsPerf/jsPerf_ImageScaling.js\u0022 );\r\n }\r\n\r\n if ( backendName_testing != backendName ) {\r\n console.log( \u0060Change backend to \u0022${backendName}\u0022...\u0060 );\r\n globalThis.backendName_testing = backendName;\r\n\r\n globalThis.jsPerf_Module.disposeResources();\r\n\r\n await tf.ready();\r\n await tf.setBackend( backendName );\r\n\r\n globalThis.jsPerf_Module.init();\r\n \tglobalThis.testCorrectnessIterator = jsPerf_Module.testCorrectness();\r\n }\r\n\r\n if ( !globalThis.testCorrectnessIterator )\r\n return true;\r\n\r\n let testCorrectnessYield = globalThis.testCorrectnessIterator.next();\r\n if ( testCorrectnessYield.done ) {\r\n console.log( \u0060${backendName}, initialization done.\u0060 );\r\n globalThis.testCorrectnessIterator = null;\r\n return true;\r\n } else {\r\n\treturn false;\r\n }\r\n}","TestCases":[{"Name":"Async wait for init (WASM)","Code":"if ( ( globalThis.initPromiseWASM ) \u0026\u0026 ( globalThis.initPromiseWebGL ) \u0026\u0026 ( globalThis.initPromiseCPU ) ) { // For benchmark re-run.\r\n globalThis.initPromiseWASM = globalThis.initPromiseWebGL = globalThis.initPromiseCPU = null;\r\n}\r\n\r\nconst backendName = \u0022wasm\u0022;\r\n//const backendName = \u0022webgl\u0022;\r\n//const backendName = \u0022cpu\u0022;\r\nif ( !globalThis.initPromiseWASM ) {\r\n globalThis.initPromiseWASM = init( backendName );\r\n} else {\r\n globalThis.initPromiseWASM.then( ( done ) =\u003E {\r\n if ( !done ) {\r\n globalThis.initPromiseWASM = init( backendName );\r\n } else {\r\n }\r\n });\r\n}\r\n","IsDeferred":false},{"Name":"(General) OffscreenCanvas_from_Canvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_OffscreenCanvas_from_Canvas();","IsDeferred":false},{"Name":"(General) OffscreenCanvas_from_Canvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_OffscreenCanvas_from_Canvas_ImageData();","IsDeferred":false},{"Name":"(General) OffscreenCanvas_from_OffscreenCanvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_OffscreenCanvas_from_OffscreenCanvas();","IsDeferred":false},{"Name":"(General) OffscreenCanvas_from_OffscreenCanvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_OffscreenCanvas_from_OffscreenCanvas_ImageData();","IsDeferred":false},{"Name":"(WASM) 1","Code":"1;","IsDeferred":false},{"Name":"(WASM) Tensor_from_Canvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas();","IsDeferred":false},{"Name":"(WASM) Tensor_from_Canvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas_ImageData();","IsDeferred":false},{"Name":"(WASM) Tensor_from_Canvas_TypedArray","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas_TypedArray();","IsDeferred":false},{"Name":"(WASM) Tensor_from_OffscreenCanvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas();","IsDeferred":false},{"Name":"(WASM) Tensor_from_OffscreenCanvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas_ImageData();","IsDeferred":false},{"Name":"(WASM) Tensor_from_OffscreenCanvas_TypedArray","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas_TypedArray();","IsDeferred":false},{"Name":"(WASM) 2","Code":"2;","IsDeferred":false},{"Name":"Async wait for init (CPU)","Code":"const backendName = \u0022cpu\u0022;\r\nif ( !globalThis.initPromiseCPU ) {\r\n globalThis.initPromiseCPU = init( backendName );\r\n} else {\r\n globalThis.initPromiseCPU.then( ( done ) =\u003E {\r\n if ( !done ) {\r\n globalThis.initPromiseCPU = init( backendName );\r\n } else {\r\n }\r\n });\r\n}\r\n","IsDeferred":false},{"Name":" (CPU) Tensor_from_Canvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas();","IsDeferred":false},{"Name":"(CPU) Tensor_from_Canvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas_ImageData();","IsDeferred":false},{"Name":"(CPU) Tensor_from_Canvas_TypedArray","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas_TypedArray();","IsDeferred":false},{"Name":"(CPU) Tensor_from_OffscreenCanvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas();","IsDeferred":false},{"Name":"(CPU) Tensor_from_OffscreenCanvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas_ImageData();","IsDeferred":false},{"Name":"(CPU) Tensor_from_OffscreenCanvas_TypedArray","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas_TypedArray();","IsDeferred":false},{"Name":"(CPU) 1","Code":"1;","IsDeferred":false},{"Name":"Async wait for init (WebGL)","Code":"const backendName = \u0022webgl\u0022;\r\nif ( !globalThis.initPromiseWebGL ) {\r\n globalThis.initPromiseWebGL = init( backendName );\r\n} else {\r\n globalThis.initPromiseWebGL.then( ( done ) =\u003E {\r\n if ( !done ) {\r\n globalThis.initPromiseWebGL = init( backendName );\r\n } else {\r\n }\r\n });\r\n}\r\n","IsDeferred":false},{"Name":"(WebGL) Tensor_from_Canvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas();","IsDeferred":false},{"Name":"(WebGL) Tensor_from_Canvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas_ImageData();","IsDeferred":false},{"Name":"(WebGL) Tensor_from_Canvas_TypedArray","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_Canvas_TypedArray();","IsDeferred":false},{"Name":"(WebGL) Tensor_from_OffscreenCanvas","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas();","IsDeferred":false},{"Name":"(WebGL) Tensor_from_OffscreenCanvas_ImageData","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas_ImageData();","IsDeferred":false},{"Name":"(WebGL) Tensor_from_OffscreenCanvas_TypedArray","Code":"globalThis.testSet_108x192x4.testImageScaling_by_Tensor_from_OffscreenCanvas_TypedArray();","IsDeferred":false}]}