-
Notifications
You must be signed in to change notification settings - Fork 23
Build error with Clang #29
Copy link
Copy link
Open
Description
torch-blocksparse/csrc/utils.cpp
Line 115 in 9aa9478
| torch::Tensor scratch = torch::empty({H, layout.sum().item<int>(), 4}, layout.dtype()); |
Please have a look at this line. Implicit conversion from size_t to long is treated as an error in Clang.
/tmp/pip-install-62i124mf/torch-blocksparse/csrc/utils.cpp:115:41: error: non-constant-expression cannot be narrowed from type 'size_
t' (aka 'unsigned long') to 'long' in initializer list [-Wc++11-narrowing]
torch::Tensor scratch = torch::empty({H, layout.sum().item<int>(), 4}, layout.dtype());
^
/tmp/pip-install-62i124mf/torch-blocksparse/csrc/utils.cpp:115:41: note: insert an explicit cast to silence this issue
torch::Tensor scratch = torch::empty({H, layout.sum().item<int>(), 4}, layout.dtype());
^
static_cast<long>( )
Using GCC avoids the error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels