parameters: (self)
return_statement: return dev
docstring: Return a string representation of this `DeviceSpec`.
  
      Returns:
        a string of the form
        /job:<name>/replica:<id>/task:<id>/device:<device_type>:<id>.
docstring_summary: Return a string representation of this `DeviceSpec`.
docstring_tokens: Return a string representation of this DeviceSpec .
function: def to_string(self):
      """Return a string representation of this `DeviceSpec`.
  
      Returns:
        a string of the form
        /job:<name>/replica:<id>/task:<id>/device:<device_type>:<id>.
      """
      dev = ""
      if self.job is not None:
        dev += "/job:" + self.job
      if self.replica is not None:
        dev += "/replica:" + str(self.replica)
      if self.task is not None:
        dev += "/task:" + str(self.task)
      if self.device_type is not None:
        device_index_string = "*"
        if self.device_index is not None:
          device_index_string = str(self.device_index)
        dev += "/device:%s:%s" % (self.device_type, device_index_string)
      return dev
function_tokens: def to_string ( self ) : dev = "" if self . job is not None : dev += "/job:" + self . job if self . replica is not None : dev += "/replica:" + str ( self . replica ) if self . task is not None : dev += "/task:" + str ( self . task ) if self . device_type is not None : device_index_string = "*" if self . device_index is not None : device_index_string = str ( self . device_index ) dev += "/device:%s:%s" % ( self . device_type , device_index_string ) return dev