Skip to content

Conversation

@lixiaolei1982
Copy link

Description

Fixed incorrect variable name in pixel_tokens_with_pos_embed reshaping operation where num_h_patches_per_window was used instead of num_w_patches_per_window for the width dimension.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Changes Made

  • Change: num_h_patches_per_windownum_w_patches_per_window in the fourth dimension of reshape operation
  • File: rfdetr/models/backbone/dinov2_with_windowed_attn.py
  • Line: ~315

Code Comparison

Before:

windowed_pixel_tokens = pixel_tokens_with_pos_embed.reshape(
    batch_size * num_windows, num_h_patches_per_window, 
    num_windows, num_h_patches_per_window, -1)

**After:**
```python
windowed_pixel_tokens = pixel_tokens_with_pos_embed.reshape(
    batch_size * num_windows, num_h_patches_per_window, 
    num_windows, num_w_patches_per_window, -1)

## Impact
- Improves code readability and consistency
- No functional changes

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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