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

Division by zero raises exception even when NumPy could handle it

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
numpy, python

調査の方向性

Start by reading leanpass/tensor.py, focusing on Tensor.__truediv__ and its current zero check. Decide which division-by-zero behavior is intended—NumPy’s inf/nan results or an epsilon-based approach—and document that choice. Done means division follows the chosen behavior instead of raising the current hard error.

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

説明

enhancement

File: leanpass/tensor.py

Tensor.__truediv__ checks np.any(other.data == 0) and raises ZeroDivisionError. NumPy already defines IEEE‑754 behavior (inf, -inf, nan) for element‑wise division, and many models rely on that. Raising an exception prevents legitimate use‑cases (e.g., masking with zero). Replace the hard error with a guarded operation that either returns inf/nan or adds a small epsilon, and document the chosen behavior.

Filed automatically by ai-issue-scan.

主要言語
Python
スター
16
フォーク
1
平均マージ
2日 8時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

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

Terminay/leanpass のほかの issue

Terminay/leanpass の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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