Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Incorrect shape assertion in test_decode_prefixes_device_handling

オープン
#23 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@samuelstevens がすでに取り組んでいます。

2025年10月14日 から。

  • #24 @samuelstevens による — オープン

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python

調査の方向性

test/test_nn_objectives.py を開き、491 行目付近の test_decode_prefixes_device_handling を、期待される decode の shape を含めて確認してください。CUDA 対応システムでテストを実行し、ドキュメントに記載された (batch, n_prefixes, d_model) の順序に一致するように assertion を更新してください。

索引モデルが issue の本文から書いたものです。

説明

Bug Description

The test test_decode_prefixes_device_handling in tests/test_nn_objectives.py has an incorrect shape assertion on line 491.

Current Code

f_x = torch.randn(2, 32).cuda()
prefixes = torch.tensor([8, 16, 32])
x_hats = sae.decode(f_x, prefixes=prefixes)
assert x_hats.shape == (3, 2, 16)  # BUG: Wrong shape!

Expected Behavior

The decode method returns tensors with shape (batch, n_prefixes, d_model). Given:

  • batch_size = 2
  • n_prefixes = 3
  • d_model = 16

The correct shape should be (2, 3, 16) not (3, 2, 16).

Impact

This test is currently skipped on systems without CUDA, so the bug hasn't been caught by CI. However, on CUDA-enabled systems, this test would fail.

Fix

Change line 491 from:

assert x_hats.shape == (3, 2, 16)

to:

assert x_hats.shape == (2, 3, 16)
主要言語
Python
スター
67
フォーク
12
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Imageomics/saev のほかの issue

Imageomics/saev の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。