rf-detr
rf-detr copied to clipboard
fix: correct variable name in pixel_tokens_with_pos_embed reshape operation
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
- [x] Bug fix (non-breaking change which fixes an issue)
Changes Made
- Change:
num_h_patches_per_window→num_w_patches_per_windowin 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