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

Fix the issue of calculating Resample2d's scales #8

Merged
merged 1 commit into from
May 19, 2023

Conversation

mingmingtasd
Copy link

scales.size()=2, input_rank>2 will cause crash. Now fixed.

@mingmingtasd mingmingtasd changed the title Fix the issue of calculating Resize's scales Fix the issue of calculating Resample2d's scales May 19, 2023
Copy link
Owner

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

Thanks Mingming. ⭐

@fdwr fdwr merged commit cd1c8e5 into fdwr:dml_sd May 19, 2023
{
scales[i] = static_cast<float>(output_shape[i]) / input_shape[i];
}
scales[0] = output_shape[axes[0]] / input_shape[axes[0]];

Choose a reason for hiding this comment

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

Is the static_cast<float> missed? Otherwise, the division result would be an integer.

Fix it (and the mode) in PR #9

Copy link
Author

Choose a reason for hiding this comment

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

Is the static_cast<float> missed? Otherwise, the division result would be an integer.

Fix it (and the mode) in PR #9

Thanks! @huningxin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants