Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] linspace op gets wrong result #16416

Closed
taomiao opened this issue Jan 17, 2024 · 0 comments
Closed

[Bug] linspace op gets wrong result #16416

taomiao opened this issue Jan 17, 2024 · 0 comments
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug

Comments

@taomiao
Copy link
Contributor

taomiao commented Jan 17, 2024

Thanks for participating in the TVM community! We use https://discuss.tvm.ai for any general usage questions and discussions. The issue tracker is used for actionable items such as feature proposals discussion, roadmaps, and bug tracking. You are always welcomed to post on the forum first 😸

Issues that are inactive for a period of time may get closed. We adopt this policy so that we won't lose track of actionable issues that may fall at the bottom of the pile. Feel free to reopen a new one if you feel there is an additional problem that needs attention when an old one gets closed.

Expected behavior

work well

Actual behavior

test_forward.py:211: in verify_model
    assert_shapes_match(baseline_output, output)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

tru = array([0.       , 0.8888889, 1.7777778, 2.6666667, 3.5555556, 4.4444447,
       5.3333335, 6.2222223, 7.111111 , 8.       ], dtype=float32)
est = array([0.       , 0.8888889, 1.7777778, 2.6666667, 3.5555556, 4.4444447,
       5.3333335, 6.2222223, 7.111111 , 8.       , 8.888889 ],
      dtype=float32)

    def assert_shapes_match(tru, est):
        """Verfiy whether the shapes are equal"""
        if tru.shape != est.shape:
            msg = "Output shapes {} and {} don't match"
>           raise AssertionError(msg.format(tru.shape, est.shape))
E           AssertionError: Output shapes (10,) and (11,) don't match

Environment

os: ubuntu
python: 3.9
pytorch: 2.0
tvm: main branch

Steps to reproduce

@tvm.testing.uses_gpu
def test_forward_linspace():
    """test_forward_linspace"""
    torch.set_grad_enabled(False)

    class Linspace9(Module):
        def forward(self, *args):
            return torch.linspace(0, 8, 10)

    verify_model(Linspace9().float().eval())

Triage

Please refer to the list of label tags here to find the relevant tags and add them below in a bullet format (example below).

  • needs-triage
  • frontend:pytorch
@taomiao taomiao added needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug labels Jan 17, 2024
@masahi masahi closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage PRs or issues that need to be investigated by maintainers to find the right assignees to address it type: bug
Projects
None yet
Development

No branches or pull requests

2 participants