onnx / onnx/optimizer

fuse_consecutive_squeezes issue: consecutive negtive axes

Open
#35 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
834
Forks
109
Avg merge
6h 55m
Merged PRs (30d)
2

Description

issue:

// Before:
// X is a tensor with shape=[1, 5000, 1, 1]
// Y = Squeeze(X, axes=[-1]) -> shape=[1, 5000, 1]
// Z = Squeeze(Y, axes=[-1]) -> shape=[1, 5000]
// After:
// Z = Squeeze(X, axes=[-1, 0]) -> shape=[5000, 1]

it should be
Z = Squeeze(X, axes=[-2, -1]) -> shape=[1, 5000]
or
Z = Squeeze(X, axes=[2, 3]) -> shape=[1, 5000]

codes resulted in line 93:
ret.push_back(i + prev_num + 1);
it's only right for positive axes values

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start at line 93 in the fuse_consecutive_squeezes implementation and trace how consecutive negative axes are adjusted. Reproduce the issue with the tensor shapes and Squeeze examples in this report; done means the fused operation preserves the expected shape for negative and positive axes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
performance
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.