I would like to retrieve tensorflow device placement as data I can manipulate from within python.
tf.debugging.set_log_device_placement(True) to log the device placement to stderr, however I haven’t found a way to catch it into a variable.
I tried both using
contextlib.redirect_stderr and adding a
tf.get_logger(), none of these resulted in the logging output being caught.
See my original question from stack overflow.