license import { Elu , KernelConfig , KernelFunc } from '@tensorflow/tfjs-core' ; import { unaryKernelFunc } from '../kernel_utils/kernel_funcs_utils' ; const ELU = `return (x >= 0.0) ? x : (exp(x) - 1.0);` ; const ELU_PACKED = `
  vec4 result;

  result.r = (x.r >= 0.0) ? x.r : (exp(x.r) - 1.0);
  result.g = (x.g >= 0.0) ? x.g : (exp(x.g) - 1.0);
  result.b = (x.b >= 0.0) ? x.b : (exp(x.b) - 1.0);
  result.a = (x.a >= 0.0) ? x.a : (exp(x.a) - 1.0);

  return result;
` ; const elu = unaryKernelFunc ( { opSnippet : ELU , packedOpSnippet : ELU_PACKED } ) ; export const eluConfig = { kernelName : Elu , backendName : 'webgl' , kernelFunc : elu as { } as KernelFunc } ;