Skip to content

Commit

Permalink
Better error for non-numeric types
Browse files Browse the repository at this point in the history
  • Loading branch information
danijar committed Jul 2, 2024
1 parent d886c9a commit 0d0a1d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion zerofun/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.1.1'
__version__ = '2.1.2'

import multiprocessing as mp
try:
Expand Down
2 changes: 2 additions & 0 deletions zerofun/sockets.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ def pack(data):
dtypes, shapes, buffers = [], [], []
for value in leaves:
value = np.asarray(value)
if value.dtype == object:
raise TypeError(data)
assert value.data.c_contiguous, (
"Array is not contiguous in memory. Use np.asarray(arr, order='C') " +
"before passing the data into pack().")
Expand Down

0 comments on commit 0d0a1d7

Please sign in to comment.