mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix clang-tidy bugprone* warnings (#148529)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/148529 Approved by: https://github.com/ezyang
This commit is contained in:
committed by
PyTorch MergeBot
parent
3f920f3d8f
commit
07bb097698
@ -280,6 +280,7 @@ static PyObject* THPModule_crashIfvptrUBSAN(PyObject* module, PyObject* noarg) {
|
||||
virtual ~Baz() = default;
|
||||
};
|
||||
Baz x{};
|
||||
// NOLINTNEXTLINE(bugprone-casting*)
|
||||
auto y = static_cast<Foo*>(static_cast<void*>(&x));
|
||||
auto rc = y->bar();
|
||||
return THPUtils_packInt32(rc);
|
||||
@ -2371,7 +2372,7 @@ Call this whenever a new thread is created in order to propagate values from
|
||||
auto acc = at::getAccelerator(check.value_or(false));
|
||||
if (acc.has_value()) {
|
||||
bool is_available = at::globalContext()
|
||||
.getAcceleratorHooksInterface(acc.value())
|
||||
.getAcceleratorHooksInterface(acc)
|
||||
.isAvailable();
|
||||
|
||||
if (!is_available) {
|
||||
|
Reference in New Issue
Block a user