pytorch
4dae85c3 - [ATen][rocm] fix type issue (#72676)

Commit
2 years ago
[ATen][rocm] fix type issue (#72676) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/72676 Fixes a nightly build failure at AMD. Originally, ``` std::initializer_list<int64_t> size = { param_size * num_linear_layers / 2, 1}; ``` but https://github.com/pytorch/pytorch/pull/71925 changes as follows. ``` const auto size = { static_cast<int64_t>(bias_size * num_linear_layers / 2), 1L}; ``` This caused a problem as follows (with a certain compiler): ``` /pytorch/aten/src/ATen/native/miopen/RNN_miopen.cpp:356:108: error: no matching function for call to 'at::Tensor::set_(const c10::Storage&, size_t&, const std::initializer_list<const long int>&)' ``` This patch reverts the type of `size`. ``` std::initializer_list<int64_t> size = { static_cast<int64_t>(bias_size * num_linear_layers / 2), 1L}; ``` This issue happens with GCC <= 9.1, but not with Clang and GCC >= 9.2. See this: https://godbolt.org/z/sbErY7her (Note: please let me explcitly cast the first variable (`bias_size * num_linear_layers / 2`) to avoid signed/unsigned type conversion warning. It should not cause any issue.) Test Plan: CI Reviewed By: malfet Differential Revision: D34153890 fbshipit-source-id: 791434c57ed669f95a36a79584bad5586ef66a28 (cherry picked from commit e6435065544da05087004253d856c5ce8269b2af)
Committer
Parents
Loading