mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
cleanup unused include (#93359)
Using `include-what-you-use` tool to find out and remove some unused includes Pull Request resolved: https://github.com/pytorch/pytorch/pull/93359 Approved by: https://github.com/malfet
This commit is contained in:
parent
27efdc5eed
commit
fa65ae8f56
|
|
@ -1,7 +1,6 @@
|
|||
#include <ATen/CPUGeneratorImpl.h>
|
||||
#include <ATen/Utils.h>
|
||||
#include <ATen/core/MT19937RNGEngine.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/MathConstants.h>
|
||||
#include <algorithm>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,18 +2,12 @@
|
|||
|
||||
#include <ATen/Context.h>
|
||||
|
||||
#include <c10/core/TensorOptions.h>
|
||||
#include <c10/core/CPUAllocator.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <mutex>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include <ATen/Tensor.h>
|
||||
#include <ATen/cpu/FlushDenormal.h>
|
||||
|
||||
#ifdef USE_FBGEMM
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include <ATen/EmptyTensor.h>
|
||||
#include <ATen/FunctionalTensorWrapper.h>
|
||||
#include <ATen/core/LegacyTypeDispatch.h>
|
||||
#include <c10/core/CPUAllocator.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <c10/macros/Macros.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <c10/macros/Export.h>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <c10/core/impl/alloc_cpu.h>
|
||||
#include <c10/mobile/CPUCachingAllocator.h>
|
||||
#include <c10/mobile/CPUProfilingAllocator.h>
|
||||
#include <c10/util/Logging.h>
|
||||
|
||||
// TODO: rename flag to C10
|
||||
C10_DEFINE_bool(
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include <mutex>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <c10/core/Allocator.h>
|
||||
#include <c10/core/alignment.h> // legacy, update dependents to include this directly
|
||||
#include <c10/util/Logging.h>
|
||||
#include <c10/util/Flags.h>
|
||||
|
||||
// TODO: rename to c10
|
||||
C10_DECLARE_bool(caffe2_report_cpu_memory_usage);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#include <exception>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
namespace c10 {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
#include <c10/core/DeviceType.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/Optional.h>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
namespace c10 {
|
||||
|
|
|
|||
|
|
@ -2,11 +2,8 @@
|
|||
|
||||
#include <c10/core/DeviceType.h>
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/ArrayRef.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include <c10/core/GeneratorImpl.h>
|
||||
#include <chrono>
|
||||
#include <random>
|
||||
|
||||
#if defined(__SGX_ENABLED__)
|
||||
|
|
@ -9,6 +8,7 @@
|
|||
#ifndef _WIN32
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <chrono>
|
||||
#endif
|
||||
|
||||
namespace c10 {
|
||||
|
|
|
|||
|
|
@ -1,17 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <atomic>
|
||||
#include <deque>
|
||||
#include <mutex>
|
||||
#include <typeinfo>
|
||||
#include <utility>
|
||||
|
||||
#include <c10/core/Device.h>
|
||||
#include <c10/core/DispatchKeySet.h>
|
||||
#include <c10/core/TensorImpl.h>
|
||||
#include <c10/util/C++17.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <c10/macros/Export.h>
|
||||
#include <c10/util/intrusive_ptr.h>
|
||||
#include <c10/util/python_stub.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
#include <c10/core/GradMode.h>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
bool GradMode::is_enabled() {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include <c10/core/InferenceMode.h>
|
||||
#include <stdexcept>
|
||||
|
||||
namespace c10 {
|
||||
// Invariant:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#include <c10/core/SafePyObject.h>
|
||||
#include <c10/core/TensorImpl.h>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/intrusive_ptr.h>
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
class C10_API SymBool {
|
||||
|
|
|
|||
|
|
@ -4,11 +4,8 @@
|
|||
#include <c10/core/SymNodeImpl.h>
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/intrusive_ptr.h>
|
||||
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,6 @@
|
|||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/Optional.h>
|
||||
|
||||
#include <array>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace c10 {
|
||||
using SymIntArrayRef = ArrayRef<SymInt>;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@
|
|||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/intrusive_ptr.h>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <vector>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
#include <c10/core/SafePyObject.h>
|
||||
#include <c10/macros/Macros.h>
|
||||
#include <c10/util/ArrayRef.h>
|
||||
#include <c10/util/Optional.h>
|
||||
|
||||
namespace c10 {
|
||||
namespace impl {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <functional>
|
||||
#include <mutex>
|
||||
|
|
@ -7,8 +8,6 @@
|
|||
#include <thread>
|
||||
#include <utility>
|
||||
|
||||
#include <c10/util/Optional.h>
|
||||
#include <c10/util/intrusive_ptr.h>
|
||||
#include <c10/util/numa.h>
|
||||
#include <c10/util/thread_name.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/StringUtil.h>
|
||||
|
||||
#include <cstring>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include <c10/util/Exception.h>
|
||||
#include <c10/util/ThreadLocal.h>
|
||||
#include <c10/util/ThreadLocalDebugInfo.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include <c10/macros/Export.h>
|
||||
#include <c10/util/Exception.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@
|
|||
#include <c10/util/int128.h>
|
||||
#include <iomanip>
|
||||
#include <ostream> // NOLINT(readability/streams)
|
||||
#include <sstream>
|
||||
|
||||
namespace c10 {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <c10/util/Logging.h>
|
||||
#include <c10/util/Optional.h>
|
||||
|
||||
C10_DECLARE_bool(caffe2_cpu_numa_enabled);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <unordered_set>
|
||||
|
||||
#ifdef C10_ANDROID
|
||||
#ifndef SYS_gettid
|
||||
|
|
|
|||
|
|
@ -4,15 +4,9 @@
|
|||
#include <algorithm>
|
||||
#include <atomic>
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
#include <cxxabi.h>
|
||||
#endif
|
||||
|
||||
using std::string;
|
||||
|
||||
namespace caffe2 {
|
||||
namespace detail {
|
||||
C10_EXPORT void _ThrowRuntimeTypeLogicError(const string& msg) {
|
||||
C10_EXPORT void _ThrowRuntimeTypeLogicError(const std::string& msg) {
|
||||
// In earlier versions it used to be std::abort() but it's a bit hard-core
|
||||
// for a library
|
||||
TORCH_CHECK(false, msg);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include <random>
|
||||
|
||||
#include <c10/core/alignment.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include "caffe2/core/context.h"
|
||||
#include "caffe2/proto/caffe2_pb.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include <c10/core/alignment.h>
|
||||
#include <torch/csrc/jit/runtime/static/memory_planner.h>
|
||||
|
||||
#include <ATen/Tensor.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user