license import { backend_util , KernelConfig , Selu } from '@tensorflow/tfjs-core' ; import { unaryKernelFunc } from '../utils/unary_utils' ; const scaleAlpha = backend_util . SELU_SCALEALPHA ; const scale = backend_util . SELU_SCALE ; export const selu = unaryKernelFunc ( Selu , ( xi ) => { if ( xi >= 0 ) { return scale * xi ; } else { return scaleAlpha * ( Math . exp ( xi ) - 1 ) ; } } ) ; export const seluConfig = { kernelName : Selu , backendName : 'cpu' , kernelFunc : selu , } ;