license import { backend_util , cast , KernelConfig , Pow , PowInputs , Tensor , tidy } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const powConfig = { kernelName : Pow , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { a , b } = args . inputs as PowInputs ; const backend = args . backend as NodeJSKernelBackend ; const dtype = backend_util . upcastType ( a . dtype , b . dtype ) ; const opAttrs = [ createTensorsTypeOpAttr ( 'T' , dtype ) ] ; return tidy ( ( ) => { return backend . executeSingleOutput ( Pow , opAttrs , [ cast ( a as Tensor , dtype ) , cast ( b as Tensor , dtype ) ] ) ; } ) ; } } ;