license import { KernelConfig , KernelFunc , ResizeNearestNeighborGrad , ResizeNearestNeighborGradAttrs , ResizeNearestNeighborGradInputs , TensorInfo } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { ResizeNearestNeigborBackpropProgram } from '../resize_nearest_neighbor_backprop_gpu' ; export function resizeNearestNeighborGrad ( args ) { const { inputs , backend , attrs } = args ; const { images , dy } = inputs ; const { alignCorners } = attrs ; const program = new ResizeNearestNeigborBackpropProgram ( dy . shape as [ number , number , number , number ] , images . shape as [ number , number , number , number ] , alignCorners ) ; return backend . runWebGLProgram ( program , [ dy ] , dy . dtype ) ; } export const resizeNearestNeighborGradConfig = { kernelName : ResizeNearestNeighborGrad , backendName : 'webgl' , kernelFunc : resizeNearestNeighborGrad as { } as KernelFunc } ;