{"record":{"id":"b6cd7b891f1c5971","repo":"jax-ml/jax","slug":"the-out-argument-to-jnp-outer-is-not-supported","errorCode":null,"errorMessage":"The 'out' argument to jnp.outer is not supported.","messagePattern":"The 'out' argument to jnp\\.outer is not supported\\.","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"jax/_src/numpy/tensor_contractions.py","lineNumber":682,"sourceCode":"\n  Returns:\n    The outer product of the inputs ``a`` and ``b``. Returned array\n    will be of shape ``(a.size, b.size)``.\n\n  See also:\n    - :func:`jax.numpy.inner`: compute the inner product of two arrays.\n    - :func:`jax.numpy.einsum`: Einstein summation.\n\n  Examples:\n    >>> a = jnp.array([1, 2, 3])\n    >>> b = jnp.array([4, 5, 6])\n    >>> jnp.outer(a, b)\n    Array([[ 4,  5,  6],\n           [ 8, 10, 12],\n           [12, 15, 18]], dtype=int32)\n  \"\"\"\n  if out is not None:\n    raise NotImplementedError(\"The 'out' argument to jnp.outer is not supported.\")\n  a, b = util.ensure_arraylike(\"outer\", a, b)\n  a, b = util.promote_dtypes(a, b)\n  return a.ravel()[:, None] * b.ravel()[None, :]\n","sourceCodeStart":664,"sourceCodeEnd":686,"githubUrl":"https://github.com/jax-ml/jax/blob/1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb/jax/_src/numpy/tensor_contractions.py#L664-L686","documentation":"jnp.outer mirrors numpy.outer's signature including the out parameter, but JAX arrays are immutable so writing into a caller-provided buffer is impossible. Passing anything other than None for out raises NotImplementedError.","triggerScenarios":"jnp.outer(a, b, out=result_array) with any non-None out value.","commonSituations":"Porting numpy code that used out= to reuse buffers; performance-tuning habits from numpy that do not apply in JAX.","solutions":["Drop the out argument and use the returned array","If buffer reuse is needed, restructure to functional style (out = jnp.outer(a,b))","Use block_until_ready / donation only at jit boundaries if memory reuse is the goal"],"exampleFix":"// before\nnp.outer(a, b, out=buf)\n// after\nouter = jnp.outer(a, b)","handlingStrategy":"type-guard","validationCode":"assert out is None, 'jnp.outer does not support out='","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Strip out= kwargs when adapting numpy code to JAX"],"tags":["jax","outer","immutable-arrays","numpy-compat"],"backgroundTag":"unsupported-out-parameter","analyzedSha":"1e1c6a8fc06dfcd1247076ec5cae4640cea5d7bb","analyzedAt":"2026-08-27T09:53:25.647Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}