license import { AvgPool3DGrad , AvgPool3DGradAttrs , AvgPool3DGradInputs , backend_util , KernelConfig , KernelFunc , TensorInfo } from '@tensorflow/tfjs-core' ; import { AvgPool3DBackpropProgram } from '../avg_pool_backprop_gpu' ; import { MathBackendWebGL } from '../backend_webgl' ; export function avgPool3DGrad ( args ) { const { inputs , backend , attrs } = args ; const { dy , input } = inputs ; const x = input ; const { filterSize , strides , pad , dimRoundingMode } = attrs ; const dilations = [ 1 , 1 , 1 ] ; const convInfo = backend_util . computePool3DInfo ( x . shape as [ number , number , number , number , number ] , filterSize , strides , dilations , pad , dimRoundingMode ) ; const avgPoolBackpropProgram = new AvgPool3DBackpropProgram ( convInfo ) ; return backend . runWebGLProgram ( avgPoolBackpropProgram , [ dy ] , x . dtype ) ; } export const avgPool3DGradConfig = { kernelName : AvgPool3DGrad , backendName : 'webgl' , kernelFunc : avgPool3DGrad as { } as KernelFunc } ;