license import { KernelConfig , Max , MaxAttrs , MaxInputs , tensor1d , util } from '@tensorflow/tfjs' ; import { NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const maxConfig = { kernelName : Max , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { x } = args . inputs as MaxInputs ; const backend = args . backend as NodeJSKernelBackend ; const { reductionIndices , keepDims } = args . attrs as { } as MaxAttrs ; const axes = util . parseAxisParam ( reductionIndices , x . shape ) ; const axesTensor = tensor1d ( axes , 'int32' ) ; const res = backend . executeSingleOutput ( Max , backend . createReductionOpAttrs ( x , keepDims ) , [ x , axesTensor ] ) ; axesTensor . dispose ( ) ; return res ; } } ;