Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement multi-dimensional repeat operation and rename existing repeat method #1715

Open
antimora opened this issue Apr 30, 2024 · 2 comments
Labels
enhancement Enhance existing features

Comments

@antimora
Copy link
Collaborator

Currently, Burn's repeat method only supports repeating along one dimension at a time. To enhance functionality and align with common deep learning frameworks like PyTorch, we need to implement a new repeat operation that accepts multiple dimensions simultaneously. This will provide the same behavior as PyTorch's repeat.

To avoid confusion and maintain consistency with other Burn methods, we should rename the existing repeat method to repeat_dim, similar to other *_dim methods in the library.

Implementing this multi-dimensional repeat operation is crucial for supporting the Tile ONNX operator, which is commonly used in many user-submitted models. The lack of this functionality has been reported by users, as highlighted in issue #1714.

Tasks:

  1. Implement a new repeat method that accepts multiple dimensions and repeats the tensor along those dimensions simultaneously.
  2. Rename the existing repeat method to repeat_dim for consistency with other *_dim methods.
  3. Update the documentation and examples to reflect the new repeat method and the renamed repeat_dim method.
  4. Add unit tests to verify the correctness of the multi-dimensional repeat operation.
  5. Ensure compatibility with the Tile ONNX operator and test with user-submitted models that require this functionality.

By completing these tasks, we will provide a more comprehensive and user-friendly repeat operation in Burn, enabling users to easily repeat tensors along multiple dimensions and improving compatibility with ONNX models.

@antimora antimora added the enhancement Enhance existing features label Apr 30, 2024
@antimora
Copy link
Collaborator Author

CC: @louisfd, @nathanielsimard, @laggui

@louisfd
Copy link
Member

louisfd commented Apr 30, 2024

It should be easy to make a default implementation that calls repeat_dim once for each dimension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhance existing features
Projects
None yet
Development

No branches or pull requests

2 participants