mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
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:
parent
395f853770
commit
b283b1de39
|
|
@ -1,10 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <memory>
|
||||
#include <numeric>
|
||||
|
||||
#include <c10/core/Backend.h>
|
||||
#include <c10/core/CopyBytes.h>
|
||||
#include <c10/core/DispatchKeySet.h>
|
||||
|
|
@ -22,6 +17,11 @@
|
|||
#include <c10/util/irange.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
|
||||
// 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.
|
||||
|
|
@ -60,7 +60,7 @@ namespace c10 {
|
|||
/**
|
||||
* 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());
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user