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

Method min

tensorflow/python/framework/dtypes.py:177–198  ·  view source on GitHub ↗

Returns the minimum representable value in this data type. Raises: TypeError: if this is a non-numeric, unordered, or quantized type.

(self)

Source from the content-addressed store, hash-verified

175
176 @property
177 def min(self):
178 """Returns the minimum representable value in this data type.
179
180 Raises:
181 TypeError: if this is a non-numeric, unordered, or quantized type.
182
183 """
184 if (self.is_quantized or
185 self.base_dtype in (bool, string, complex64, complex128)):
186 raise TypeError("Cannot find minimum value of %s." % self)
187
188 # there is no simple way to get the min value of a dtype, we have to check
189 # float and int types separately
190 try:
191 return np.finfo(self.as_numpy_dtype()).min
192 except: # bare except as possible raises by finfo not documented
193 try:
194 return np.iinfo(self.as_numpy_dtype()).min
195 except:
196 if self.base_dtype == bfloat16:
197 return _np_bfloat16(float.fromhex("-0x1.FEp127"))
198 raise TypeError("Cannot find minimum value of %s." % self)
199
200 @property
201 def max(self):

Callers 15

testFloatBasicMethod · 0.45
testDoubleBasicMethod · 0.45
testRangeMethod · 0.45
_assertIntegralMethod · 0.45
_use_composite_implFunction · 0.45
splitMethod · 0.45
splitMethod · 0.45
_runnerMethod · 0.45
testRangeMethod · 0.45
_range_testMethod · 0.45
assertAllGreaterMethod · 0.45

Calls 1

as_numpy_dtypeMethod · 0.95

Tested by 15

testFloatBasicMethod · 0.36
testDoubleBasicMethod · 0.36
testRangeMethod · 0.36
_assertIntegralMethod · 0.36
_runnerMethod · 0.36
testRangeMethod · 0.36
_range_testMethod · 0.36
assertAllGreaterMethod · 0.36
assertAllGreaterEqualMethod · 0.36
testDynamicNoiseShapeMethod · 0.36