Skip to content

Add tile op - #438

Merged
angeloskath merged 6 commits into
ml-explore:mainfrom
dc-dc-dc:tile
Jan 13, 2024
Merged

angeloskath merged 6 commits into
ml-explore:mainfrom
dc-dc-dc:tile

Conversation

@dc-dc-dc

Copy link
Copy Markdown
Contributor

Proposed changes

Adds the tile op, continuation from #317. @angeloskath this approach simplifies the execution based on your suggestions. Only utilizing 3 ops (2 reshapes / 1 broadcast)

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)

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks this looks very nice, it is almost exactly what I had in mind :-) .

I left a comment regarding simplification. I think it can be simplified even more which imho makes it much more understandable.

Also I think the case where len(reps) > arr.ndim is not handled properly. At least it is not tested.

Comment thread mlx/ops.cpp Resolved
Comment thread python/tests/test_ops.py Resolved

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the back and forth. It looks great and now matches numpy's functionality.

Given your latest change I think 4 lines are now unnecessary so remove them and then it is merged :-) .

Comment thread mlx/ops.cpp Resolved
Comment thread mlx/ops.cpp Resolved

@angeloskath angeloskath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great!

@angeloskath
angeloskath merged commit 2e29d08 into ml-explore:main Jan 13, 2024
@dc-dc-dc
dc-dc-dc deleted the tile branch January 13, 2024 16:47
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