Skip to content

🌐 [translation-sync] [numpy_vs_numba_vs_jax] Fix deprecated device= argument on jax.jit#128

Merged
mmcky merged 2 commits into
mainfrom
translation-sync-2026-06-19T03-18-53-pr-563
Jun 19, 2026
Merged

🌐 [translation-sync] [numpy_vs_numba_vs_jax] Fix deprecated device= argument on jax.jit#128
mmcky merged 2 commits into
mainfrom
translation-sync-2026-06-19T03-18-53-pr-563

Conversation

@mmcky

@mmcky mmcky commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Automated Translation Sync

This PR contains automated translations from QuantEcon/lecture-python-programming.

Source PR

#563 - [numpy_vs_numba_vs_jax] Fix deprecated device= argument on jax.jit

Files Updated

  • ✏️ lectures/numpy_vs_numba_vs_jax.md
  • ✏️ .translate/state/numpy_vs_numba_vs_jax.md.yml

Details

  • Source Language: en
  • Target Language: fa
  • Model: claude-sonnet-4-6

This PR was created automatically by the translation action.

@netlify

netlify Bot commented Jun 19, 2026

Copy link
Copy Markdown

Deploy Preview for majestic-griffin-10b166 ready!

Name Link
🔨 Latest commit 96b91af
🔍 Latest deploy log https://app.netlify.com/projects/majestic-griffin-10b166/deploys/6a34b522e842340008492f53
😎 Deploy Preview https://deploy-preview-128--majestic-griffin-10b166.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

✅ Translation Quality Review

Verdict: PASS | Model: claude-sonnet-4-6 | Date: 2026-06-19


📝 Translation Quality

Criterion Score
Accuracy 9/10
Fluency 9/10
Terminology 9/10
Formatting 10/10
Overall 9.2/10

Summary: The translation of the modified sections (Summary for vectorized operations, First Attempt, and Second Attempt) is of high quality. Technical accuracy is excellent, with JAX-specific concepts and explanations well-rendered in Persian. The formatting is perfectly preserved with no syntax errors. Minor fluency issues include a slightly imprecise rendering of 'workaround' as 'راه‌حل' and a few slightly unnatural phrasings, but these do not significantly impede comprehension. Overall, the translation is accurate, fluent, and professionally executed. Technical terminology is consistently and accurately translated throughout all modified sections, with proper Persian equivalents for JAX-specific concepts like 'lax.fori_loop', 'lax.scan', and 'at[t].set'. The Summary sections for both 'Vectorized operations' and 'Sequential operations' accurately convey the comparative analysis between NumPy, Numba, and JAX, preserving all key points about speed, memory efficiency, and code readability. All MyST formatting, code blocks, LaTeX math, and cross-references are perfectly preserved in the modified sections with no syntax errors. The translation of the First Attempt section handles complex technical explanations about JAX's immutability and in-place updates clearly and accurately in Persian. Academic register is maintained consistently across all modified sections, using appropriate formal Persian throughout.

Suggestions:

  • تلاش اول - 'در اینجا یک راه‌حل با استفاده از سینتکس at[t].set ارائه می‌شود که {ref}در درس JAX بحث شد <jax_at_workaround>.' → The English source says 'Here's a workaround using the at[t].set syntax we {ref}discussed in the JAX lecture <jax_at_workaround>.' The word 'workaround' (راه‌حل جایگزین/کار‌گریز) carries a slightly different nuance than just 'راه‌حل' (solution). Consider using 'راه‌حل جایگزین' or 'روش کار‌گریز' to preserve the original meaning.

  • Summary (Sequential operations) - 'نسخه‌های JAX، از سوی دیگر، نیاز به استفاده از lax.fori_loop یا lax.scan دارند که هر دو کمتر شهودی از یک حلقه استاندارد Python هستند.' → The English says 'both of which are less intuitive than a standard Python loop.' The Persian phrase 'کمتر شهودی از' is slightly unnatural; consider 'هر دو کمتر شهودی‌تر از یک حلقه استاندارد Python هستند' or 'که هیچ‌کدام به اندازه یک حلقه استاندارد Python شهودی نیستند' for more natural flow.

  • تلاش دوم - 'این روش جایگزین، به طور قابل بحث، بیشتر با رویکرد تابعی JAX همسو است' → The English says 'This alternative is arguably more in line with JAX's functional approach'. The phrase 'به طور قابل بحث' is a literal translation of 'arguably' but sounds somewhat awkward in Persian academic writing. A more natural rendering would be 'این روش جایگزین، به نوعی، بیشتر با رویکرد تابعی JAX همسو است' or 'می‌توان گفت این روش جایگزین بیشتر با رویکرد تابعی JAX همسو است'.


🔍 Diff Quality

Check Status
Scope Correct
Position Correct
Structure Preserved
Heading-map Correct
Overall 10/10

Summary: The translation correctly mirrors all source changes: the new x0_cpu variable, updated device pinning approach via jax.device_put, removal of device=cpu from @partial decorators, and updated explanatory text appear in the same positions in both qm_jax_fori and qm_jax_scan sections, with function call arguments updated from 0.1 to x0_cpu throughout.


This review was generated automatically by action-translation review mode.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This translation-sync PR updates the Persian numpy_vs_numba_vs_jax lecture to avoid using the deprecated device= argument on jax.jit, aligning the example with current JAX usage while keeping the computation pinned to CPU.

Changes:

  • Removed device=cpu from @partial(jax.jit, ...) decorators in the JAX examples.
  • Added x0_cpu = jax.device_put(0.1, cpu) and updated example calls to pass x0_cpu to keep execution on CPU.
  • Updated translation sync state metadata (source-sha, synced-at) for this lecture.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lectures/numpy_vs_numba_vs_jax.md Reworks the JAX JIT CPU-pinning example to use jax.device_put instead of deprecated device= on jax.jit.
.translate/state/numpy_vs_numba_vs_jax.md.yml Updates translation-sync tracking metadata to the new upstream source SHA and sync date.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown

@mmcky mmcky merged commit 6167963 into main Jun 19, 2026
12 checks passed
@mmcky mmcky deleted the translation-sync-2026-06-19T03-18-53-pr-563 branch June 19, 2026 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants