c++ - How to get visible devices for Tensorflow?

Viewed 417

I am trying to fetch visible devices in Tensorflow C API. The following commands shows me 0 devices!

#include <tensorflow/core/public/session.h>
using namespace tensorflow;
...
tensorflow::SessionOptions tf_options;
std::cout << tf_options.config.device_count().size();

Does anyone knows how can I do it?

0 Answers
Related