Python – tensorflow.DeviceSpec.device_index Attribute
TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks.
device_index is used to get the device index of DeviceSpec.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course
Returns: It returns the device index.
Device Spec: <tensorflow.python.framework.device_spec.DeviceSpecV2 object at 0x7fe5ba96aee8> Device Index: 0
Device Spec: <tensorflow.python.framework.device_spec.DeviceSpecV2 object at 0x7fe5ba97f048> Device Index: 1