MCPcopy Create free account
hub / github.com/activeloopai/deeplake / upcast_array

Function upcast_array

python/deeplake/integrations/mm/upcast_array.py:5–15  ·  view source on GitHub ↗
(arr: Union[np.ndarray, bytes])

Source from the content-addressed store, hash-verified

3
4
5def upcast_array(arr: Union[np.ndarray, bytes]):
6 if isinstance(arr, list):
7 return [upcast_array(a) for a in arr]
8 if isinstance(arr, np.ndarray):
9 if arr.dtype == np.uint16:
10 return arr.astype(np.int32)
11 if arr.dtype == np.uint32:
12 return arr.astype(np.int64)
13 if arr.dtype == np.uint64:
14 return arr.astype(np.int64)
15 return arr

Callers 3

transformFunction · 0.90
transformFunction · 0.90
get_gt_seg_mapsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected