Skip to content

Replace direct use of int32_t with an alias DeviceIndex#13019

Closed
ezyang wants to merge 1 commit intoexport-D10513246from
export-D10520295
Closed

Replace direct use of int32_t with an alias DeviceIndex#13019
ezyang wants to merge 1 commit intoexport-D10513246from
export-D10520295

Conversation

@ezyang
Copy link
Copy Markdown
Contributor

@ezyang ezyang commented Oct 23, 2018

Stack:
    :white_circle:  #12995 Move Device and DeviceType to c10  💛
    :black_circle:  #13019 Replace direct use of int32_t with an alias DeviceIndex  💛
    :white_circle:  #13021 Delete default constructor from CUDAStream.  💛

It just makes the semantic meaning of the int32_t a little
bit clearer.

Differential Revision: D10520295

Differential Revision: D10520295
Differential Version: 61458546
@zou3519
Copy link
Copy Markdown
Contributor

zou3519 commented Oct 24, 2018

Is there a reason why the native_functions get_device returns an int64_t?

- func: get_device(Tensor self) -> int64_t

@ezyang
Copy link
Copy Markdown
Contributor Author

ezyang commented Oct 24, 2018

@zou3519 It's probably because in our API we generally return int64_t even if a smaller type could make sense. Might not be unreasonable to narrow this one too.

@soumith soumith deleted the export-D10520295 branch February 21, 2019 12:12
@ezyang ezyang added the merged label Jun 25, 2019
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#13019

It just makes the semantic meaning of the int32_t a little
bit clearer.

Reviewed By: zou3519

Differential Revision: D10520295

fbshipit-source-id: 45b0bd1b6afddee17072b628d8e9b87d7c86e501
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