Whether the tensor is on the first (canonical) device.

    Tensors not assigned to a device are assumed to be on all devices, including
    the canonical device.

    Args:
      tensor_name: a string, name of a tensor in the graph.

    Returns:
      a boolean indicating whether the tensor is on the first device.

def is_tensor_on_canonical_device(self, tensor_name):
    """Whether the tensor is on the first (canonical) device.

    Tensors not assigned to a device are assumed to be on all devices, including
    the canonical device.

    Args:
      tensor_name: a string, name of a tensor in the graph.

    Returns:
      a boolean indicating whether the tensor is on the first device.
    """
    device = self.get_tensor_device(tensor_name)
    return not device or device == self.canonical_device