license import { backend_util , DepthwiseConv2dNativeBackpropFilter , DepthwiseConv2dNativeBackpropFilterAttrs , DepthwiseConv2dNativeBackpropFilterInputs , KernelConfig , KernelFunc } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { DepthwiseConv2DDerFilterProgram } from '../conv_backprop_gpu_depthwise' ; export function depthwiseConv2dNativeBackpropFilter ( args ) { const { inputs , backend , attrs } = args ; const { x , dy } = inputs ; const { strides , dilations , pad , dimRoundingMode , filterShape } = attrs ; const convInfo = backend_util . computeConv2DInfo ( x . shape as [ number , number , number , number ] , filterShape , strides , dilations , pad , dimRoundingMode , true ) ; const program = new DepthwiseConv2DDerFilterProgram ( convInfo ) ; return backend . runWebGLProgram ( program , [ x , dy ] , 'float32' ) ; } export const depthwiseConv2dNativeBackpropFilterConfig = { kernelName : DepthwiseConv2dNativeBackpropFilter , backendName : 'webgl' , kernelFunc : depthwiseConv2dNativeBackpropFilter as { } as KernelFunc } ;