MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / LookupDeviceOrdinal

Function LookupDeviceOrdinal

tensorflow/compiler/xla/python/xla.cc:156–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156StatusOr<std::shared_ptr<Device>> LookupDeviceOrdinal(
157 PyLocalClient* client, int device_ordinal, absl::string_view caller_name) {
158 if (device_ordinal < 0 || device_ordinal >= client->local_device_count()) {
159 return InvalidArgument(
160 "%s got bad device_ordinal: %d (num_local_devices=%d)", caller_name,
161 device_ordinal, client->local_device_count());
162 }
163 return client->local_devices()[device_ordinal];
164}
165
166// PEP 3118 buffer protocol implementation.
167

Callers

nothing calls this directly

Calls 3

InvalidArgumentFunction · 0.85
local_device_countMethod · 0.45
local_devicesMethod · 0.45

Tested by

no test coverage detected