{"record":{"id":"3fca3e085c765b15","repo":"jax-ml/jax","slug":"self-r-has-no-manual-axis-type-3fca3e","errorCode":null,"errorMessage":"{self!r} has no `manual_axis_type`.","messagePattern":"(.+?) has no `manual_axis_type`\\.","errorType":"exception","errorClass":"AttributeError","httpStatus":null,"severity":"error","filePath":"jax/_src/state/types.py","lineNumber":557,"sourceCode":"      raise AttributeError(\n          f\"{self!r} has no `dtype`.\"\n      ) from None\n\n  @property\n  def sharding(self):\n    try:\n      return self.inner_aval.sharding  # pyrefly: ignore[missing-attribute]\n    except AttributeError:\n      raise AttributeError(\n          f\"{self!r} has no `sharding`.\"\n      ) from None\n\n  @property\n  def manual_axis_type(self):\n    try:\n      return self.inner_aval.manual_axis_type  # pyrefly: ignore[missing-attribute]\n    except AttributeError:\n      raise AttributeError(\n          f\"{self!r} has no `manual_axis_type`.\"\n      ) from None\n\n  @property\n  def mat(self):\n    return self.manual_axis_type\n\n  @core.aval_property\n  def at(self):\n    return RefIndexer(self)\n\n  @core.aval_method\n  def bitcast(self, dtype):\n    return TransformedRef(self, ()).bitcast(dtype)\n\n  @core.aval_method\n  def reshape(self, *shape):\n    return TransformedRef(self, ()).reshape(*shape)","sourceCodeStart":539,"sourceCodeEnd":575,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/state/types.py#L539-L575","documentation":"RefRValue.manual_axis_type raises AttributeError when the inner aval has no manual axis type (the property isn't defined for that aval kind). .mat aliases it and propagates the same error.","triggerScenarios":"Accessing .manual_axis_type or .mat on a ref whose inner aval doesn't support manual axes (non-array or plain ShapedArray without manual axis info).","commonSituations":"Code written against avals with manual axis types being reused with ordinary avals.","solutions":["Guard with getattr(ref, 'manual_axis_type', None)","Check the aval type supports manual axes before access","Provide a default axis type in calling code"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def ref_has_manual_axes(ref):\n    return hasattr(getattr(ref, \"inner_aval\", None), \"manual_axis_type\")","tryCatchPattern":null,"preventionTips":["Guard .mat access","Default axis types at call sites"],"tags":["jax","axis-type","attribute-error"],"backgroundTag":"missing-attribute-access","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}