license import { KernelConfig , LeakyRelu , LeakyReluAttrs , LeakyReluInputs , Tensor } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const leakyReluConfig = { kernelName : LeakyRelu , backendName : 'tensorflow' , kernelFunc : ( args ) => { const inputs = args . inputs as LeakyReluInputs ; const attrs = args . attrs as { } as LeakyReluAttrs ; const backend = args . backend as NodeJSKernelBackend ; const x = inputs . x as Tensor ; const alpha = attrs . alpha ; const opAttrs = [ { name : 'alpha' , type : backend . binding . TF_ATTR_FLOAT , value : alpha } , createTensorsTypeOpAttr ( 'T' , x . dtype ) ] ; return backend . executeSingleOutput ( LeakyRelu , opAttrs , [ x ] ) ; } } ;