license import { ClipByValue , ClipByValueAttrs , ClipByValueInputs , KernelConfig , maximum , minimum , scalar , Tensor , tidy } from '@tensorflow/tfjs' ; export const clipByValueConfig = { kernelName : ClipByValue , backendName : 'tensorflow' , kernelFunc : ( args ) => { const { x } = args . inputs as ClipByValueInputs ; const { clipValueMin , clipValueMax } = args . attrs as { } as ClipByValueAttrs ; return tidy ( ( ) => { const xMin = minimum ( x as Tensor , scalar ( clipValueMax , x . dtype ) ) ; return maximum ( xMin , scalar ( clipValueMin , x . dtype ) ) ; } ) ; } } ;