parameters: (spec)
return_statement: return DeviceSpec().parse_from_string(spec)
docstring: Construct a `DeviceSpec` from a string.
  
      Args:
        spec: a string of the form
         /job:<name>/replica:<id>/task:<id>/device:CPU:<id>
        or
         /job:<name>/replica:<id>/task:<id>/device:GPU:<id>
        as cpu and gpu are mutually exclusive.
        All entries are optional.
  
      Returns:
        A DeviceSpec.
docstring_summary: Construct a `DeviceSpec` from a string.
docstring_tokens: Construct a DeviceSpec from a string .
function: def from_string(spec):
      """Construct a `DeviceSpec` from a string.
  
      Args:
        spec: a string of the form
         /job:<name>/replica:<id>/task:<id>/device:CPU:<id>
        or
         /job:<name>/replica:<id>/task:<id>/device:GPU:<id>
        as cpu and gpu are mutually exclusive.
        All entries are optional.
  
      Returns:
        A DeviceSpec.
      """
      return DeviceSpec().parse_from_string(spec)
function_tokens: def from_string ( spec ) : return DeviceSpec ( ) . parse_from_string ( spec )