{"record":{"id":"f21625c3a8d3fc2a","repo":"tensorflow/models","slug":"drop-rate-is-outside-0-1","errorCode":null,"errorMessage":"drop_rate {} is outside [0, 1)","messagePattern":"drop_rate (.+?) is outside \\[0, 1\\)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/pix2seq/modeling/transformer.py","lineNumber":181,"sourceCode":"    }\n    config.update(updates)\n    return config\n\n\ndef suffix_id(i):\n  \"\"\"Return suffix id for layer/variable name.\"\"\"\n  return '' if i == 0 else '_%d' % i\n\n\nclass DropPath(tf_keras.layers.Layer):\n  \"\"\"For stochastic depth.\"\"\"\n\n  def __init__(self, drop_rate=0.0, **kwargs):\n    \"\"\"Initializes a drop path layer.\"\"\"\n    super().__init__(**kwargs)\n    self._drop_rate = drop_rate\n    if self._drop_rate < 0 or self._drop_rate >= 1.0:\n      raise ValueError('drop_rate {} is outside [0, 1)'.format(self._drop_rate))\n\n  def call(self, x, training=False):\n    \"\"\"Performs a forward pass.\n\n    Args:\n      x: An input tensor of type tf.Tensor with shape [batch, height, width,\n        channels].\n      training: A boolean flag indicating whether training behavior should be\n        used (default: False).\n\n    Returns:\n      The output tensor.\n    \"\"\"\n    if self._drop_rate == 0.0 or not training:\n      return x\n\n    keep_rate = 1.0 - self._drop_rate\n    xshape = tf.shape(x)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/pix2seq/modeling/transformer.py#L163-L199","documentation":"Error \"drop_rate {} is outside [0, 1)\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/pix2seq/modeling/transformer.py:181 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"}