license import { _FusedMatMul , _FusedMatMulAttrs , _FusedMatMulInputs , add , KernelConfig , matMul , Tensor , Tensor3D , tidy } from '@tensorflow/tfjs' ; import { NodeJSKernelBackend } from '../nodejs_kernel_backend' ; export const _fusedMatMulConfig = { kernelName : _FusedMatMul , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { a , b , bias , preluActivationWeights } = args . inputs as _FusedMatMulInputs ; const backend = args . backend as NodeJSKernelBackend ; const { transposeA , transposeB , activation , leakyreluAlpha } = args . attrs as { } as _FusedMatMulAttrs ; return tidy ( ( ) => { let result = matMul ( a as Tensor , b as Tensor , transposeA , transposeB ) ; if ( bias != null ) { result = add ( result , bias as Tensor ) ; } result = backend . applyActivation ( result , activation , preluActivationWeights as Tensor , leakyreluAlpha ) ; return result ; } ) ; } } ;