license import { KernelConfig , Tensor4D } from '@tensorflow/tfjs-core' ; import { FlipLeftRight , FlipLeftRightInputs } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { FlipLeftRightProgram } from '../flip_left_right_gpu' ; export const flipLeftRightConfig = { kernelName : FlipLeftRight , backendName : 'webgl' , kernelFunc : ( { inputs , backend } ) => { const { image } = inputs as FlipLeftRightInputs ; const webglBackend = backend as MathBackendWebGL ; const program = new FlipLeftRightProgram ( ( image as Tensor4D ) . shape ) ; const output = webglBackend . runWebGLProgram ( program , [ image ] , image . dtype ) ; return output ; } } ;