license import { Complex , ComplexInputs , KernelConfig , Tensor } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const complexConfig = { kernelName : Complex , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { real , imag } = args . inputs as ComplexInputs ; const backend = args . backend as NodeJSKernelBackend ; const opAttrs = [ createTensorsTypeOpAttr ( 'T' , real as Tensor ) , { name : 'Tout' , type : backend . binding . TF_ATTR_TYPE , value : backend . binding . TF_COMPLEX64 } , ] ; const inputs = [ real , imag ] ; return backend . executeSingleOutput ( Complex , opAttrs , inputs ) ; } } ;