Skip to content

Commit 492bd6a

Browse files
Merge pull request tensorflow#52495 from offscale:tensorflow.compiler.xla.client.client.cc
PiperOrigin-RevId: 405331077 Change-Id: I3a43fdb60ac9df90de8f941a0ef7574d4d5b9d12
2 parents a78f9ef + 28be9c4 commit 492bd6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tensorflow/compiler/xla/client/client.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,9 @@ StatusOr<std::vector<DeviceHandle>> Client::GetDeviceHandles(
380380
}
381381

382382
std::vector<DeviceHandle> device_handles;
383-
for (const DeviceHandle& device_handle : response.device_handles()) {
383+
const auto& response_device_handles = response.device_handles();
384+
device_handles.reserve(response_device_handles.size());
385+
for (const DeviceHandle& device_handle : response_device_handles) {
384386
device_handles.push_back(device_handle);
385387
}
386388

0 commit comments

Comments
 (0)