license import { KernelConfig , LRNGrad , LRNGradAttrs , LRNGradInputs } from '@tensorflow/tfjs' ; import { createTensorsTypeOpAttr , NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const LRNGradConfig = { kernelName : LRNGrad , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { x , y , dy } = args . inputs as LRNGradInputs ; const backend = args . backend as NodeJSKernelBackend ; const { depthRadius , bias , alpha , beta } = args . attrs as { } as LRNGradAttrs ; const opAttrs = [ createTensorsTypeOpAttr ( 'T' , dy . dtype ) , { name : 'depth_radius' , type : backend . binding . TF_ATTR_INT , value : depthRadius } , { name : 'bias' , type : backend . binding . TF_ATTR_FLOAT , value : bias } , { name : 'alpha' , type : backend . binding . TF_ATTR_FLOAT , value : alpha } , { name : 'beta' , type : backend . binding . TF_ATTR_FLOAT , value : beta } , ] ; return backend . executeSingleOutput ( LRNGrad , opAttrs , [ dy , x , y ] ) ; } } ;