license import { backend_util , TensorInfo } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { Pool2DProgram } from '../pool_gpu' ; export function maxPoolWithArgmaxImpl ( x , includeBatchInIndex , convInfo , backend ) { let program = new Pool2DProgram ( convInfo , 'max' , false ) ; const poolOutput = backend . runWebGLProgram ( program , [ x ] , 'float32' ) ; program = new Pool2DProgram ( convInfo , 'max' , true , true , includeBatchInIndex ) ; const indexOutput = backend . runWebGLProgram ( program , [ x ] , 'float32' ) ; return [ poolOutput , indexOutput ] ; }