license import { AvgPool3D , AvgPool3DAttrs , AvgPool3DInputs , backend_util , KernelConfig , KernelFunc , TensorInfo } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { Pool3DProgram } from '../pool_gpu' ; export function avgPool3D ( args ) { const { inputs , backend , attrs } = args ; const { x } = inputs ; const { filterSize , strides , pad , dimRoundingMode , dataFormat } = attrs ; const dilations = [ 1 , 1 , 1 ] ; const convInfo = backend_util . computePool3DInfo ( x . shape as [ number , number , number , number , number ] , filterSize , strides , dilations , pad , dimRoundingMode , dataFormat ) ; const avgPoolProgram = new Pool3DProgram ( convInfo , 'avg' , false ) ; return backend . runWebGLProgram ( avgPoolProgram , [ x ] , 'float32' ) ; } export const avgPool3DConfig = { kernelName : AvgPool3D , backendName : 'webgl' , kernelFunc : avgPool3D as { } as KernelFunc } ;