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

Class DeviceId

tensorflow/compiler/jit/device_util.h:36–54  ·  view source on GitHub ↗

Instances of DeviceId represent TensorFlow devices as integers. This helps avoid having to manipulate device names as strings when auto-clustering.

Source from the content-addressed store, hash-verified

34// This helps avoid having to manipulate device names as strings when
35// auto-clustering.
36class DeviceId {
37 public:
38 DeviceId(DeviceId&&) = default;
39 DeviceId(const DeviceId&) = default;
40 DeviceId& operator=(const DeviceId&) = default;
41
42 bool operator==(const DeviceId& other) const { return id() == other.id(); }
43 bool operator!=(const DeviceId& other) const { return !(*this == other); }
44
45 private:
46 int id_;
47
48 explicit DeviceId(int id) : id_(id) {}
49
50 int id() const { return id_; }
51
52 friend class DeviceInfoCache;
53 friend class DeviceSet;
54};
55
56// A set of DeviceIds, represented as a bitmap.
57class DeviceSet {

Callers 2

ForEachMethod · 0.85
GetIdForMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected