OptionalinitOptionaloutputsConcrete output shapes/dtypes. Provide this OR outputShapeFn.
Both are captured when apply() builds the custom primitive.
OptionaloutputDerive outputs during eager construction or a shape-specific compile trace. This JS callback is not native shape inference: MLX's CustomKernel lacks output_shapes(), so it cannot participate in shapeless replay.
OptionalstreamOptionaltemplateOptionaltemplate
Concrete launch grid, OR derive it during eager construction or tracing. Native replay reuses the captured grid without invoking this callback.