{"record":{"id":"5b3cee49048ad0b8","repo":"tensorflow/models","slug":"x-has-to-be-a-floating-point-tensor-since-it-s-goi","errorCode":null,"errorMessage":"x has to be a floating point tensor since it's going  to be scaled. Got a %s tensor instead.","messagePattern":"x has to be a floating point tensor since it's going  to be scaled\\. Got a (.+?) tensor instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"official/projects/bigbird/stateless_dropout.py","lineNumber":90,"sourceCode":"      elements.\n    seed: A shape [2] integer Tensor of seeds to the random number generator.\n      Must have dtype `tf.int32` when compiling to XLA.\n    noise_shape: A 1-D `Tensor` of type `int32`, representing the shape for\n      randomly generated keep/drop flags.\n    name: A name for this operation (optional).\n\n  Returns:\n    A `Tensor` of the same shape of `x`.\n\n  Raises:\n    ValueError: If `rate` is not in `[0, 1)` or if `x` is not a floating point\n      tensor. `rate=1` is disallowed, because the output would be all zeros,\n      which is likely not what was intended.\n  \"\"\"\n  with tf.name_scope(name or 'stateless_dropout') as name:\n    x = tf.convert_to_tensor(x, name='x')\n    if not x.dtype.is_floating:\n      raise ValueError('x has to be a floating point tensor since it\\'s going '\n                       ' to be scaled. Got a %s tensor instead.' % x.dtype)\n    if isinstance(rate, numbers.Real):\n      if not (rate >= 0 and rate < 1):\n        raise ValueError('rate must be a scalar tensor or a float in the '\n                         'range [0, 1), got %g' % rate)\n      if rate > 0.5:\n        logging.log_first_n(\n            logging.WARN, 'Large dropout rate: %g (>0.5). In TensorFlow '\n            '.x, dropout() uses dropout rate instead of keep_prob. '\n            'Please ensure that this is intended.', 5, rate)\n\n    # Early return if nothing needs to be dropped.\n    if tf.get_static_value(rate) == 0:\n      return x\n\n    rate = tf.convert_to_tensor(rate, dtype=x.dtype, name='rate')\n    rate.shape.assert_has_rank(0)\n    noise_shape = _get_noise_shape(x, noise_shape)","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/bigbird/stateless_dropout.py#L72-L108","documentation":"Error \"x has to be a floating point tensor since it's going  to be scaled. Got a %s tensor instead.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/bigbird/stateless_dropout.py:90 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"}