Pre-allocate memory for vectors where size is already known.
PiperOrigin-RevId: 354117982 Change-Id: I868507ccb54c700973dc2c923fc2dda9b3d5bfac
This commit is contained in:
parent
c1837809c1
commit
2e94b05c27
@ -146,6 +146,7 @@ PYBIND11_MODULE(_pywrap_tf_cluster, m) {
|
||||
std::vector<tensorflow::OpDef> ops;
|
||||
registry->GetRegisteredOps(&ops);
|
||||
std::vector<std::string> op_names;
|
||||
op_names.reserve(ops.size());
|
||||
for (const tensorflow::OpDef& op : ops) {
|
||||
op_names.push_back(op.name());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user