Skip to content

Add unit tests for linears.py#3693

Merged
copybara-service[bot] merged 1 commit intomainfrom
add-linears-tests
Apr 20, 2026
Merged

Add unit tests for linears.py#3693
copybara-service[bot] merged 1 commit intomainfrom
add-linears-tests

Conversation

@bvandermoon
Copy link
Copy Markdown
Collaborator

@bvandermoon bvandermoon commented Apr 17, 2026

Description

This PR adds unit tests for src/maxtext/layers/linears.py, covering:

  • Utility functions: normalize_axes, canonicalize_tuple, _convert_to_activation_function.
  • DenseGeneral layer: Basic call, bias usage, and multiple axes.
  • MlpBlock layer: Basic call and fused MLP configuration.
    These tests help ensure the correctness of these core layers and improve test coverage.

Tests

I tested this change by running the new unit tests on a TPU VM.
Command: pytest tests/unit/linears_test.py
Result: 8 passed

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bvandermoon bvandermoon force-pushed the add-linears-tests branch 2 times, most recently from 03d3a66 to efc6c99 Compare April 17, 2026 21:04
Comment thread tests/unit/linears_test.py Outdated
Comment thread tests/unit/linears_test.py
@copybara-service copybara-service Bot merged commit ed0d5e6 into main Apr 20, 2026
55 checks passed
@copybara-service copybara-service Bot deleted the add-linears-tests branch April 20, 2026 20:44
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.

3 participants