diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-06-01 09:42:04 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-06-01 09:45:21 -0700 |
commit | eb10a4c494d95e7c17ddc44ef35197d08f2f6b33 (patch) | |
tree | c920e61142ba74b437c3c39036a4748ba575b039 /tensorflow/core/common_runtime/shape_refiner_test.cc | |
parent | ce32228c49e595f966485acee947131e4ab04905 (diff) |
Preallocate vector storage when the ultimate vector size is known in advance
PiperOrigin-RevId: 157724431
Diffstat (limited to 'tensorflow/core/common_runtime/shape_refiner_test.cc')
-rw-r--r-- | tensorflow/core/common_runtime/shape_refiner_test.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/core/common_runtime/shape_refiner_test.cc b/tensorflow/core/common_runtime/shape_refiner_test.cc index 986b657e0e..466b779e9b 100644 --- a/tensorflow/core/common_runtime/shape_refiner_test.cc +++ b/tensorflow/core/common_runtime/shape_refiner_test.cc @@ -259,6 +259,7 @@ REGISTER_OP("ShapeData") } std::vector<shape_inference::DimensionHandle> dims; + dims.reserve(shape_data->NumElements()); for (int i = 0; i < shape_data->NumElements(); ++i) { dims.emplace_back(c->MakeDim(shape_data->flat<int32>()(i))); } |