license import { Abs , AbsInputs , KernelConfig } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const absConfig = { kernelName : Abs , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { x } = args . inputs as AbsInputs ; const backend = args . backend as NodeJSKernelBackend ; if ( x . dtype === 'complex64' ) { const opAttrs = [ createTensorsTypeOpAttr ( 'T' , x . dtype ) , createTensorsTypeOpAttr ( 'Tout' , 'float32' ) ] ; return backend . executeSingleOutput ( 'ComplexAbs' , opAttrs , [ x ] ) ; } return backend . executeSingleInput ( Abs , x ) ; } } ;