{"record":{"id":"e700b8b527afcfc5","repo":"tensorflow/models","slug":"please-specify-epsilon-for-unknown-input-data-type","errorCode":null,"errorMessage":"Please specify epsilon for unknown input data type","messagePattern":"Please specify epsilon for unknown input data type","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/edgetpu/vision/modeling/custom_layers.py","lineNumber":424,"sourceCode":"  \"\"\"\n  fqop = _fqop if output_type.is_floating else tf.identity\n  safe_axis = axis\n  if safe_axis < 0:\n    safe_axis = len(input_tensor.shape) + safe_axis\n  reduction_size = input_tensor.shape[axis]\n  axis_max = tf.math.reduce_max(input_tensor, axis=axis, keepdims=True)\n  zero_if_max = tf.subtract(axis_max, input_tensor)\n  eps = epsilon if epsilon else 1e-6\n  if input_tensor.dtype.is_floating:\n    zero_if_max_else_eps = tf.math.minimum(\n        _nnapi_scalar(eps, input_tensor.dtype), zero_if_max)\n    zero_if_max_else_one = zero_if_max_else_eps * _nnapi_scalar(\n        1 / eps, input_tensor.dtype)\n  elif input_tensor.dtype.is_integer:\n    zero_if_max_else_one = tf.math.minimum(\n        _nnapi_scalar(1, input_tensor.dtype), zero_if_max)\n  else:\n    raise ValueError('Please specify epsilon for unknown input data type')\n\n  # Input type ends here, output type starts here\n  zero_if_max_else_one = tf.cast(zero_if_max_else_one, dtype=output_type)\n  zero_if_max_else_one = fqop(zero_if_max_else_one)\n  one_if_max_else_zero = fqop(\n      tf.math.subtract(\n          fqop(_nnapi_scalar(1, output_type)), zero_if_max_else_one))\n  rev_index = tf.range(reduction_size, 0, -1, dtype=output_type)\n  for index in range(safe_axis + 1, len(input_tensor.shape)):\n    rev_index = tf.expand_dims(rev_index, axis=index - safe_axis)\n  rev_index = fqop(rev_index)\n  rev_index_if_max_else_zero = fqop(\n      tf.math.multiply(one_if_max_else_zero, rev_index))\n  reverse_argmax = fqop(\n      tf.math.reduce_max(\n          rev_index_if_max_else_zero, axis=axis, keepdims=keepdims, name=name))\n  # Final operation obtains name if argmax layer if provided\n  return fqop(","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/edgetpu/vision/modeling/custom_layers.py#L406-L442","documentation":"Error \"Please specify epsilon for unknown input data type\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/edgetpu/vision/modeling/custom_layers.py:424 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}