Skip to content

Conversation

@malfet
Copy link
Contributor

@malfet malfet commented Apr 1, 2022

Prerequisite change for enabling `-Werror=sign-compare` across PyTorch repo

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

facebook-github-bot commented Apr 1, 2022

🔗 Helpful links

💊 CI failures summary and remediations

As of commit 503ebab (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).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

PyObject *py_strides = PyDict_GetItemString(cuda_dict, "strides");
if (py_strides != nullptr && py_strides != Py_None) {
if (PySequence_Length(py_strides) == -1 || PySequence_Length(py_strides) != sizes.size()) {
if (PySequence_Length(py_strides) == -1 || PySequence_Length(py_strides) != static_cast<Py_ssize_t>(sizes.size())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't we prefer to cast the result of PySequence_Length to size_t?
From a quick search, looks like Py_ssize_t is a int only.

Prerequisite change for enabling `-Werror=sign-compare` across PyTorch repo

[ghstack-poisoned]
Copy link
Collaborator

@albanD albanD left a comment

Choose a reason for hiding this comment

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

Thanks for the update!

facebook-github-bot pushed a commit that referenced this pull request Apr 5, 2022
Summary:
Prerequisite change for enabling `-Werror=sign-compare` across PyTorch repo

Pull Request resolved: #75079

Approved by: https://github.com/albanD

Test Plan: contbuild & OSS CI, see https://hud.pytorch.org/commit/pytorch/pytorch/c593c220ff8ecbadf065acc1bd74661bba2dc2bf

Reviewed By: seemethere, b0noI

Differential Revision: D35404324

Pulled By: malfet

fbshipit-source-id: ae08bf80fd280d0e7aca96a4747dbc888ec4adb4
@facebook-github-bot facebook-github-bot deleted the gh/malfet/43/head branch April 8, 2022 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants