MCPcopy Create free account
hub / github.com/NVIDIA/DALI / make_unsigned

Function make_unsigned

dali/test/python/test_utils.py:168–176  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

166
167def _get_absdiff(left, right):
168 def make_unsigned(dtype):
169 if not np.issubdtype(dtype, np.signedinteger):
170 return dtype
171 return {
172 np.dtype(np.int8): np.uint8,
173 np.dtype(np.int16): np.uint16,
174 np.dtype(np.int32): np.uint32,
175 np.dtype(np.int64): np.uint64,
176 }[dtype]
177
178 # np.abs of diff doesn't handle overflow for unsigned types
179 absdiff = np.maximum(left, right) - np.minimum(left, right)

Callers 1

_get_absdiffFunction · 0.85

Calls 1

dtypeMethod · 0.45

Tested by

no test coverage detected