license import { KernelConfig , Sign } from '@tensorflow/tfjs-core' ; import { unaryKernelFunc } from '../utils/unary_utils' ; export const sign = unaryKernelFunc ( Sign , ( xi ) => { if ( xi < 0 ) { return - 1 ; } else if ( xi > 0 ) { return 1 ; } else { return 0 ; } } ) ; export const signConfig = { kernelName : Sign , backendName : 'cpu' , kernelFunc : sign , } ;