mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Enable readability-redundant-smartptr-get in clang-tidy (#116381)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/116381 Approved by: https://github.com/Skylion007
This commit is contained in:
@ -55,6 +55,7 @@ readability-container-size-empty,
|
||||
readability-delete-null-pointer,
|
||||
readability-duplicate-include
|
||||
readability-misplaced-array-index,
|
||||
readability-redundant-smartptr-get,
|
||||
readability-string-compare,
|
||||
'
|
||||
HeaderFilterRegex: '^(aten/|c10/|torch/).*$'
|
||||
|
@ -91,11 +91,11 @@ struct C10_API Storage {
|
||||
|
||||
// TODO: remove later
|
||||
void set_nbytes(size_t size_bytes) const {
|
||||
storage_impl_.get()->set_nbytes(size_bytes);
|
||||
storage_impl_->set_nbytes(size_bytes);
|
||||
}
|
||||
|
||||
void set_nbytes(c10::SymInt size_bytes) const {
|
||||
storage_impl_.get()->set_nbytes(std::move(size_bytes));
|
||||
storage_impl_->set_nbytes(std::move(size_bytes));
|
||||
}
|
||||
|
||||
bool resizable() const {
|
||||
@ -129,11 +129,11 @@ struct C10_API Storage {
|
||||
|
||||
// Returns the previous data_ptr
|
||||
at::DataPtr set_data_ptr(at::DataPtr&& data_ptr) const {
|
||||
return storage_impl_.get()->set_data_ptr(std::move(data_ptr));
|
||||
return storage_impl_->set_data_ptr(std::move(data_ptr));
|
||||
}
|
||||
|
||||
void set_data_ptr_noswap(at::DataPtr&& data_ptr) const {
|
||||
return storage_impl_.get()->set_data_ptr_noswap(std::move(data_ptr));
|
||||
return storage_impl_->set_data_ptr_noswap(std::move(data_ptr));
|
||||
}
|
||||
|
||||
DeviceType device_type() const {
|
||||
@ -141,7 +141,7 @@ struct C10_API Storage {
|
||||
}
|
||||
|
||||
at::Allocator* allocator() const {
|
||||
return storage_impl_.get()->allocator();
|
||||
return storage_impl_->allocator();
|
||||
}
|
||||
|
||||
at::Device device() const {
|
||||
|
@ -39,11 +39,9 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <typeinfo>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
|
||||
@ -1120,7 +1118,7 @@ inline static uint64_t compute_min_topological_nr(const edge_list& outputs) {
|
||||
}
|
||||
auto min_topo_nr = std::numeric_limits<uint64_t>::max();
|
||||
for (auto& output_edge : outputs) {
|
||||
auto topo_nr = output_edge.function.get()->topological_nr();
|
||||
auto topo_nr = output_edge.function->topological_nr();
|
||||
min_topo_nr = (min_topo_nr < topo_nr) ? min_topo_nr : topo_nr;
|
||||
}
|
||||
return min_topo_nr;
|
||||
|
Reference in New Issue
Block a user