license import { Atan2 } from '@tensorflow/tfjs-core' ; import { KernelConfig } from '@tensorflow/tfjs-core' ; import { binaryKernelFunc , CHECK_NAN_SNIPPET_BINARY , CHECK_NAN_SNIPPET_BINARY_PACKED } from '../kernel_utils/kernel_funcs_utils' ; const ATAN2 = CHECK_NAN_SNIPPET_BINARY + `
  return atan(a, b);
` ; const ATAN2_PACKED = `
  vec4 result = atan(a, b);
  vec4 isNaN = min(vec4(isnan(a)) + vec4(isnan(b)), vec4(1.0));
  ` + CHECK_NAN_SNIPPET_BINARY_PACKED + `
  return result;
` ; export const atan2 = binaryKernelFunc ( { opSnippet : ATAN2 , packedOpSnippet : ATAN2_PACKED } ) ; export const atan2Config = { kernelName : Atan2 , backendName : 'webgl' , kernelFunc : atan2 , } ;