license import { KernelConfig , Step , StepAttrs } from '@tensorflow/tfjs-core' ; import { unaryKernelFunc } from '../utils/unary_utils' ; export const step = unaryKernelFunc ( Step , ( xi , attrs ) => { const stepAttrs = attrs as { } as StepAttrs ; if ( isNaN ( xi ) ) { return NaN ; } else { return xi > 0 ? 1 : stepAttrs . alpha ; } } ) ; export const stepConfig = { kernelName : Step , backendName : 'cpu' , kernelFunc : step , } ;