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

Function GetNumGPUs

tensorflow/core/grappler/optimizers/layout_optimizer.cc:2214–2223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2212};
2213
2214int GetNumGPUs(const Cluster& cluster) {
2215 auto devices = cluster.GetDevices();
2216 int num_gpus = 0;
2217 for (const auto& device : devices) {
2218 if (device.second.type() == "GPU") {
2219 num_gpus++;
2220 }
2221 }
2222 return num_gpus;
2223}
2224} // namespace
2225
2226Status LayoutOptimizer::Tune(const GrapplerItem& item,

Callers 1

OptimizeMethod · 0.70

Calls 1

typeMethod · 0.65

Tested by

no test coverage detected