Cleaning code in fbcode/caffe2/c10/core/TensorImpl.h (#70588)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/70588

Test Plan: Sandcastle

Reviewed By: meyering

Differential Revision: D33399751

fbshipit-source-id: 3e507973f7a8f58635f3446650e85d0f959254c0
This commit is contained in:
Richard Barnes 2022-01-05 13:39:12 -08:00 committed by Facebook GitHub Bot
parent 395f853770
commit b283b1de39

View File

@ -1,10 +1,5 @@
#pragma once #pragma once
#include <algorithm>
#include <atomic>
#include <memory>
#include <numeric>
#include <c10/core/Backend.h> #include <c10/core/Backend.h>
#include <c10/core/CopyBytes.h> #include <c10/core/CopyBytes.h>
#include <c10/core/DispatchKeySet.h> #include <c10/core/DispatchKeySet.h>
@ -22,6 +17,11 @@
#include <c10/util/irange.h> #include <c10/util/irange.h>
#include <c10/util/python_stub.h> #include <c10/util/python_stub.h>
#include <algorithm>
#include <atomic>
#include <memory>
#include <numeric>
// A global boolean variable to control whether we free memory when a Tensor // A global boolean variable to control whether we free memory when a Tensor
// is shrunk to a smaller size. As a result, a Tensor is always going to // is shrunk to a smaller size. As a result, a Tensor is always going to
// keep the memory allocated for its maximum capacity reshaped to so far. // keep the memory allocated for its maximum capacity reshaped to so far.
@ -60,7 +60,7 @@ namespace c10 {
/** /**
* A utility function to convert vector<int> to vector<int64_t>. * A utility function to convert vector<int> to vector<int64_t>.
*/ */
inline std::vector<int64_t> ToVectorint64_t(ArrayRef<int> src) { inline std::vector<int64_t> ToVectorint64_t(const ArrayRef<int>& src) {
return std::vector<int64_t>(src.begin(), src.end()); return std::vector<int64_t>(src.begin(), src.end());
} }