Skip to content

Conversation

@malfet
Copy link
Contributor

@malfet malfet commented Jun 17, 2020

Convert start and end to step_t before computing the difference
Should fix torch.linspace(-2147483647, 2147483647, 10, dtype=torch.int32)

Closes #40118

Copy link
Contributor

@pbelevich pbelevich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth it to add a test for this case?

Copy link
Collaborator

@xuhdev xuhdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a comment?

@malfet malfet force-pushed the malfet/fix-linspace-step-computation branch from 3ddaa91 to 30a7ac4 Compare June 23, 2020 15:42
@dr-ci
Copy link

dr-ci bot commented Jun 23, 2020

💊 CI failures summary and remediations

As of commit 9014baf (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 6 times.

@malfet malfet force-pushed the malfet/fix-linspace-step-computation branch from 30a7ac4 to a2db92f Compare June 23, 2020 16:23
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

malfet added 2 commits June 23, 2020 14:04
Convert start and end to `step_t` before computing the difference
Should fix `torch.linspace(-2147483647, 2147483647, 10, dtype=torch.int32)`
@malfet malfet force-pushed the malfet/fix-linspace-step-computation branch from a2db92f to 9014baf Compare June 23, 2020 21:05
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@malfet is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@malfet merged this pull request in 7e32e60.

@malfet malfet deleted the malfet/fix-linspace-step-computation branch June 24, 2020 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linspace returns wrong result for int32

5 participants