Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Division by zero raises exception even when NumPy could handle it

Đang mở
#59 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
numpy, python
Lĩnh vực
machine-learning

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
16
Fork
1
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Terminay/leanpass

Tất cả issue của Terminay/leanpass

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.