license import * as tf from '@tensorflow/tfjs-core' ; const nodeGles = require ( 'node-gles' ) ; const nodeGl = nodeGles . binding . createWebGLRenderingContext ( ) ; tf . env ( ) . set ( 'WEBGL_VERSION' , 2 ) ; tf . env ( ) . set ( 'WEBGL_RENDER_FLOAT32_ENABLED' , true ) ; tf . env ( ) . set ( 'WEBGL_DOWNLOAD_FLOAT_ENABLED' , true ) ; tf . env ( ) . set ( 'WEBGL_FENCE_API_ENABLED' , true ) ; tf . env ( ) . set ( 'WEBGL_MAX_TEXTURE_SIZE' , nodeGl . getParameter ( nodeGl . MAX_TEXTURE_SIZE ) ) ; tf . webgl . setWebGLContext ( 2 , nodeGl ) ; tf . registerBackend ( 'headless-nodegl' , ( ) => { return new tf . webgl . MathBackendWebGL ( new tf . webgl . GPGPUContext ( nodeGl ) ) ; } , 3 ) ;