Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`Tensor.sum` backward fails for multi‑axis reductions

Open Beginner friendly
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
numpy, python

Research direction

Start in leanpass/tensor.py and read the backward function for sum, especially how it handles the axis argument. Reproduce the failure with a multi-axis reduction such as axis=(0,2), then check the resulting gradient against the expected shape and values; done means tuple axes backpropagate without raising a TypeError.

Written by the indexing model from the issue text.

Description

bug

File: leanpass/tensor.py

The backward function for sum only handles a single axis (np.expand_dims(grad, axis=axis)). When axis is a tuple (e.g., axis=(0,2)) the code raises a TypeError because expand_dims expects an int. This breaks common use‑cases of summing over multiple dimensions.

Filed automatically by ai-issue-scan.

Dominant language
Python
Stars
16
Forks
1
Avg merge
2d 8h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Terminay/leanpass

All issues in Terminay/leanpass

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.