code: def testInvalidDeviceNumber(self):
      opts = tf_session.TF_NewSessionOptions()
      with ops.get_default_graph()._c_graph.get() as c_graph:
          c_session = tf_session.TF_NewSession(c_graph, opts)
      raw_device_list = tf_session.TF_SessionListDevices(c_session)
      size = tf_session.TF_DeviceListCount(raw_device_list)
      with self.assertRaises(errors.InvalidArgumentError):
          tf_session.TF_DeviceListMemoryBytes(raw_device_list, size)
      tf_session.TF_DeleteDeviceList(raw_device_list)
      tf_session.TF_CloseSession(c_session)
  
file_path: tensorflow/tensorflow/python/client/session_list_devices_test.py
imports: from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import pywrap_tf_session
  from tensorflow.python.client import session
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.platform import googletest
  from tensorflow.python.training import server_lib
label_desc: Use image node_id 2 for calling the SessionListDevicesTest obj's underlying member method code with example usage: obj.testInvalidDeviceNumber() without return types