license import { KernelConfig , Tanh } from '@tensorflow/tfjs-core' ; import { unaryKernelFunc } from '../kernel_utils/kernel_funcs_utils' ; const TANH = `
  float e2x = exp(-2.0 * abs(x));
  return sign(x) * (1.0 - e2x) / (1.0 + e2x);
` ; export const tanh = unaryKernelFunc ( { opSnippet : TANH } ) ; export const tanhConfig = { kernelName : Tanh , backendName : 'webgl' , kernelFunc : tanh , } ;