diff options
author | 2017-06-01 09:42:04 -0700 | |
---|---|---|
committer | 2017-06-01 09:45:21 -0700 | |
commit | eb10a4c494d95e7c17ddc44ef35197d08f2f6b33 (patch) | |
tree | c920e61142ba74b437c3c39036a4748ba575b039 /tensorflow/core/ops/string_ops_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/ops/string_ops_test.cc')
-rw-r--r-- | tensorflow/core/ops/string_ops_test.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tensorflow/core/ops/string_ops_test.cc b/tensorflow/core/ops/string_ops_test.cc index 79130bae2c..f4d3adbb2a 100644 --- a/tensorflow/core/ops/string_ops_test.cc +++ b/tensorflow/core/ops/string_ops_test.cc @@ -27,6 +27,7 @@ TEST(StringOpsTest, StringJoin_ShapeFn) { ShapeInferenceTestOp op("StringJoin"); int n = 3; std::vector<NodeDefBuilder::NodeOut> src_list; + src_list.reserve(n); for (int i = 0; i < n; ++i) src_list.emplace_back("a", 0, DT_STRING); TF_ASSERT_OK(NodeDefBuilder("test", "StringJoin") .Input(src_list) |