license import { backend_util , Conv2DBackpropInput , Conv2DBackpropInputAttrs , Conv2DBackpropInputInputs , KernelConfig , KernelFunc } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { Conv2DDerInputProgram } from '../conv_backprop_gpu' ; export function conv2DBackpropInput ( args ) { const { inputs , backend , attrs } = args ; const { dy , filter } = inputs ; const { inputShape , strides , pad , dataFormat , dimRoundingMode } = attrs ; const $dataFormat = backend_util . convertConv2DDataFormat ( dataFormat ) ; const convInfo = backend_util . computeConv2DInfo ( inputShape , filter . shape as [ number , number , number , number ] , strides , 1 , pad , dimRoundingMode , false , $dataFormat ) ; const program = new Conv2DDerInputProgram ( convInfo ) ; return backend . runWebGLProgram ( program , [ dy , filter ] , 'float32' ) ; } export const conv2DBackpropInputConfig = { kernelName : Conv2DBackpropInput , backendName : 'webgl' , kernelFunc : conv2DBackpropInput as { } as KernelFunc , } ;