MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / __eq__

Method __eq__

tensorflow/python/framework/device_spec.py:358–372  ·  view source on GitHub ↗

Checks if the `other` DeviceSpec is same as the current instance, eg have same value for all the internal fields. Args: other: Another DeviceSpec Returns: Return `True` if `other` is also a DeviceSpec instance and has same value as the current instance. Retu

(self, other)

Source from the content-addressed store, hash-verified

356 return output
357
358 def __eq__(self, other):
359 """Checks if the `other` DeviceSpec is same as the current instance, eg have
360
361 same value for all the internal fields.
362
363 Args:
364 other: Another DeviceSpec
365
366 Returns:
367 Return `True` if `other` is also a DeviceSpec instance and has same value
368 as the current instance.
369 Return `False` otherwise.
370 """
371 return (isinstance(other, self.__class__) and
372 self.to_string() == other.to_string())
373
374 def __hash__(self):
375 return self._hash

Callers

nothing calls this directly

Calls 1

to_stringMethod · 0.95

Tested by

no test coverage detected