license import { env , KernelConfig , KernelFunc , MirrorPad , MirrorPadAttrs , MirrorPadInputs , TensorInfo } from '@tensorflow/tfjs-core' ; import { MathBackendWebGL } from '../backend_webgl' ; import { MirrorPadProgram } from '../mirror_pad_gpu' ; import { MirrorPadPackedProgram } from '../mirror_pad_packed_gpu' ; export const mirrorPadKernelFunc = ( { inputs , backend , attrs } ) => { const { x } = inputs ; const { paddings , mode } = attrs ; const program = env ( ) . getBool ( 'WEBGL_PACK_ARRAY_OPERATIONS' ) ? new MirrorPadPackedProgram ( x . shape , paddings , mode ) : new MirrorPadProgram ( x . shape , paddings , mode ) ; const output = backend . runWebGLProgram ( program , [ x ] , x . dtype ) ; return output ; } ; export const mirrorPadConfig = { kernelName : MirrorPad , backendName : 'webgl' , kernelFunc : mirrorPadKernelFunc as { } as KernelFunc , } ;