{"record":{"id":"49bc63a74225786e","repo":"jax-ml/jax","slug":"the-is-deleted-method-was-called-on-self-error","errorCode":null,"errorMessage":"The is_deleted() method was called on {self._error_repr()}.{self._origin_msg()}","messagePattern":"The is_deleted\\(\\) method was called on (.+?)\\.(.+?)","errorType":"exception","errorClass":"ConcretizationTypeError","httpStatus":null,"severity":"error","filePath":"jax/_src/core.py","lineNumber":1255,"sourceCode":"\n  def delete(self):\n    raise ConcretizationTypeError(self,\n      f\"The delete() method was called on {self._error_repr()}.\"\n      f\"{self._origin_msg()}\")\n\n  def devices(self):\n    raise ConcretizationTypeError(self,\n      f\"The devices() method was called on {self._error_repr()}.\"\n      f\"{self._origin_msg()}\")\n\n  @property\n  def global_shards(self):\n    raise ConcretizationTypeError(self,\n      f\"The global_shards property was called on {self._error_repr()}.\"\n      f\"{self._origin_msg()}\")\n\n  def is_deleted(self):\n    raise ConcretizationTypeError(self,\n      f\"The is_deleted() method was called on {self._error_repr()}.\"\n      f\"{self._origin_msg()}\")\n\n  @property\n  def is_fully_addressable(self):\n    raise ConcretizationTypeError(self,\n      f\"The is_fully_addressable property was called on {self._error_repr()}.\"\n      f\"{self._origin_msg()}\")\n\n  @property\n  def is_fully_replicated(self):\n    raise ConcretizationTypeError(self,\n      f\"The is_fully_replicated property was called on {self._error_repr()}.\"\n      f\"{self._origin_msg()}\")\n\n  def on_device_size_in_bytes(self):\n    raise ConcretizationTypeError(self,\n      f\"The on_device_size_in_bytes() method was called on {self._error_repr()}.\"","sourceCodeStart":1237,"sourceCodeEnd":1273,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/core.py#L1237-L1273","documentation":"ConcretizationTypeError raised when Tracer.is_deleted() is called. is_deleted() reports whether a materialized jax.Array's buffers were explicitly deleted; tracers own no buffers so the question is meaningless and the base-class stub raises ConcretizationTypeError.","triggerScenarios":"Calling `x.is_deleted()` on a value being traced inside jax.jit/grad/vmap/pmap/scan/remat or a custom derivative rule.","commonSituations":"Defensive cleanup code that checks is_deleted() before reusing buffers, reused inside a jitted training step; buffer-pool logic written for concrete arrays getting applied to traced intermediates; refactoring data-loader code under vmap.","solutions":["Remove the is_deleted() check from traced code; traced intermediates cannot be deleted.","Perform liveness checks on concrete arrays before/after calling the jitted function.","If buffer reuse matters, use jax.jit(..., donate_argnums=...) to let JAX reclaim argument buffers safely.","Guard with isinstance(x, jax.Array) if the helper must serve both traced and concrete values."],"exampleFix":"// before\n@jax.jit\ndef f(x):\n    if x.is_deleted(): ...   # ConcretizationTypeError\n    return x + 1\n\n// after\n@jax.jit\ndef f(x):\n    return x + 1\n# caller: if x.is_deleted(): x = x.copy()","handlingStrategy":"type-guard","validationCode":"import jax\n\ndef is_deleted_safe(x) -> bool:\n    if isinstance(x, jax.core.Tracer):\n        return False\n    return x.is_deleted()","typeGuard":"import jax\nfrom jax.core import Tracer\n\ndef liveness_checkable(x) -> bool:\n    return isinstance(x, jax.Array) and not isinstance(x, Tracer)","tryCatchPattern":"from jax.errors import ConcretizationTypeError\ntry:\n    gone = x.is_deleted()\nexcept ConcretizationTypeError:\n    gone = False  # tracers are never 'deleted'","preventionTips":["Only track liveness for concrete buffers in the host driver.","Rely on donate_argnums for buffer reuse rather than manual delete/is_deleted tracking.","Guard shared buffer-pool helpers with isinstance checks."],"tags":["jax","concretization","tracer","memory-management","is-deleted"],"backgroundTag":"jax-tracer-concretization-error","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}