Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC : Add compile state example#2910

Merged
awni merged 2 commits intoml-explore:mainfrom
Satyam12singh:add-compile-state-example
Dec 16, 2025
Merged

DOC : Add compile state example#2910
awni merged 2 commits intoml-explore:mainfrom
Satyam12singh:add-compile-state-example

Conversation

@Satyam12singh
Copy link
Contributor

Proposed changes

This PR addresses an inconsistency in the "Pure Functions" subsection of the mlx.compile documentation.

The guide currently mentions two methods for capturing mutable external state, but only provides a code example for the second method.

Problem: The text states, "The first option is to simply pass state as input to the function," but this method was not demonstrated with code.

Solution: This change inserts the missing code block, which explicitly shows the technique of passing state as an argument. This provides a clear contrast between the two options and improves the overall clarity and completeness of the documentation section.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@Satyam12singh Satyam12singh changed the title Add compile state example DOC : Add compile state example Dec 13, 2025
Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@Satyam12singh
Copy link
Contributor Author

Thanks for the approval, @awni ! Is there anything else you need from my side before this is ready to be merged?

@awni awni merged commit 6b330eb into ml-explore:main Dec 16, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants