message: Update keras.backend to rely on public API for device_spec.
diff: @@ -43,7 +43,7 @@ from tensorflow.python.eager import lift_to_graph
  from tensorflow.python.framework import composite_tensor
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  -from tensorflow.python.framework import device as tfdev
  +from tensorflow.python.framework import device_spec
  from tensorflow.python.framework import dtypes as dtypes_module
  from tensorflow.python.framework import func_graph
  from tensorflow.python.framework import ops
  @@ -725,7 +725,7 @@ class _TfDeviceCaptureOp(object):
  def _set_device(self, device):
  """This method captures TF's explicit device scope setting."""
  - if tfdev.is_device_spec(device):
  + if isinstance(device, device_spec.DeviceSpecV2):
  device = device.to_string()
  self.device = device
  @@ -744,7 +744,10 @@ def _get_current_tf_device():
  graph = get_graph()
  op = _TfDeviceCaptureOp()
  graph._apply_device_functions(op)
  - return tfdev.DeviceSpec.from_string(op.device)
  + if tf2.enabled():
  + return device_spec.DeviceSpecV2.from_string(op.device)
  + else:
  + return device_spec.DeviceSpecV1.from_string(op.device)
  def _is_current_explicit_device(device_type):
  