license import { KernelConfig , KernelFunc , Mod } from '@tensorflow/tfjs-core' ; import { CHECK_NAN_SNIPPET } from '../binaryop_packed_gpu' ; import { binaryKernelFunc } from '../kernel_utils/kernel_funcs_utils' ; const MOD = `if (b == 0.0) return NAN;
  return mod(a, b);` ; const MOD_PACKED = `
  vec4 result = mod(a, b);
  vec4 isNaN = vec4(equal(b, vec4(0.0)));
  ` + CHECK_NAN_SNIPPET + `
  return result;
` ; export const mod = binaryKernelFunc ( { opSnippet : MOD , packedOpSnippet : MOD_PACKED , } ) ; export const modConfig = { kernelName : Mod , backendName : 'webgl' , kernelFunc : mod as { } as KernelFunc } ;