Added __hash__ function to boundedtensorspec
PiperOrigin-RevId: 277569874 Change-Id: I84066386db50dd1a5ee05075f13f14f33f896016
This commit is contained in:
parent
235e1ff472
commit
f04053d46d
@ -279,6 +279,9 @@ class BoundedTensorSpec(TensorSpec):
|
|||||||
return (tensor_spec_eq and np.allclose(self.minimum, other.minimum) and
|
return (tensor_spec_eq and np.allclose(self.minimum, other.minimum) and
|
||||||
np.allclose(self.maximum, other.maximum))
|
np.allclose(self.maximum, other.maximum))
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash((self._shape_tuple, self.dtype))
|
||||||
|
|
||||||
def __reduce__(self):
|
def __reduce__(self):
|
||||||
return BoundedTensorSpec, (self._shape, self._dtype, self._minimum,
|
return BoundedTensorSpec, (self._shape, self._dtype, self._minimum,
|
||||||
self._maximum, self._name)
|
self._maximum, self._name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user