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

[Util] relax ndarray check

parent 7af2e0a6
No related branches found
No related tags found
No related merge requests found
......@@ -255,7 +255,8 @@ def finnpy_to_packed_bytearray(ndarray, dtype):
of 8 bits. The returned ndarray has the same number of dimensions as the
input.
"""
if type(ndarray) != np.ndarray or ndarray.dtype != np.float32:
if (not issubclass(type(ndarray), np.ndarray)) or ndarray.dtype != np.float32:
# try to convert to a float numpy array (container dtype is float)
ndarray = np.asarray(ndarray, dtype=np.float32)
# pack innermost dim to hex strings padded to 8 bits
......
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