pytorch
026fd36c - Use at::kLong for torch::tensor(integer_value) when dtype is not specified (#29066)

Commit
5 years ago
Use at::kLong for torch::tensor(integer_value) when dtype is not specified (#29066) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/29066 This PR is BC-breaking in the following way: Previously, C++ `torch::tensor` with an integer literal or a braced-init-list of integer literals produces a tensor with dtype being the type of the integer literal(s). After this PR, it always produces a tensor of dtype `at::kLong` (aka. int64_t), matching Python `torch.tensor` behavior. Test Plan: Imported from OSS Differential Revision: D18307248 Pulled By: yf225 fbshipit-source-id: 7a8a2eefa113cbb238f23264843bdb3b77fec668
Author
Will Feng
Parents
Loading