license import { backend_util , KernelConfig , Select , SelectInputs } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const selectConfig = { kernelName : Select , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { condition , t , e } = args . inputs as SelectInputs ; const backend = args . backend as NodeJSKernelBackend ; const opAttrs = [ createTensorsTypeOpAttr ( 'T' , backend_util . upcastType ( t . dtype , e . dtype ) ) ] ; return backend . executeSingleOutput ( Select , opAttrs , [ condition , t , e ] ) ; } } ;