Skip to content

Conversation

@forfudan
Copy link
Collaborator

@forfudan forfudan commented Mar 3, 2025

This will:

  1. Implemented take_along_axis function in numojo/routines/indexing.mojo:

    • Takes values from an input array along a specified axis based on indices
    • Handles arrays of any dimension with axis specification
    • Supports broadcasting of indices when shapes don't exactly match
    • Includes proper error handling for invalid inputs
  2. Created comprehensive test suite in tests/routines/test_indexing.mojo:

    • Tests for arrays of different dimensions (1D, 2D, 3D)
    • Tests with various axis specifications (positive, negative indices)
    • Tests with different index types (int32, int64)
    • Verification against NumPy's implementation for correctness

@MadAlex1997 MadAlex1997 merged commit 8bf5c93 into Mojo-Numerics-and-Algorithms-group:pre-0.7 Mar 5, 2025
2 checks passed
@forfudan forfudan deleted the take branch March 6, 2025 10:12
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