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

Function DLContextForDevice

tensorflow/compiler/xla/python/dlpack.cc:206–211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206StatusOr<DLContext> DLContextForDevice(const Device& device) {
207 DLContext context;
208 TF_ASSIGN_OR_RETURN(context.device_type, DLDeviceTypeForDevice(device));
209 context.device_id = device.local_device_state()->device_ordinal();
210 return context;
211}
212
213StatusOr<std::shared_ptr<Device>> DeviceForDLContext(
214 const PyLocalClient& client, const DLContext& context) {

Callers 1

Calls 4

DLDeviceTypeForDeviceFunction · 0.85
local_device_stateMethod · 0.80
TF_ASSIGN_OR_RETURNFunction · 0.50
device_ordinalMethod · 0.45

Tested by

no test coverage detected