license import { KernelConfig , KernelFunc , Select , SelectInputs , TensorInfo , upcastType } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { SelectProgram } from '../select_gpu' ; export function select ( args ) { const { inputs , backend } = args ; const { condition , t , e } = inputs ; const program = new SelectProgram ( condition . shape . length , t . shape , t . shape . length ) ; return backend . runWebGLProgram ( program , [ condition , t , e ] , upcastType ( t . dtype , e . dtype ) ) ; } export const selectConfig = { kernelName : Select , backendName : 'webgl' , kernelFunc : select as { } as KernelFunc } ;