Skip to content
Snippets Groups Projects
Commit 7dd5b411 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Util] more relaxation for ndarray type detection

parent e4bb7c2d
No related branches found
No related tags found
No related merge requests found
......@@ -280,7 +280,9 @@ def packed_bytearray_to_finnpy(packed_bytearray, dtype, output_shape=None):
given DataType. output_shape can be specified to remove padding from the
packed dimension, or set to None to be inferred from the input."""
if type(packed_bytearray) != np.ndarray or packed_bytearray.dtype != np.uint8:
if (
not issubclass(type(packed_bytearray), np.ndarray)
) or packed_bytearray.dtype != np.uint8:
raise Exception("packed_bytearray_to_finnpy needs NumPy uint8 arrays")
if packed_bytearray.ndim == 0:
raise Exception("packed_bytearray_to_finnpy expects at least 1D ndarray")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment