This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
nd.stack causes abort for differently sized arrays #9380
Labels
Comments
@piiswrong in this case is the expected result with shape (10,3)? |
@eric-haibin-lin So this wasn't so much about it doing the right thing as simply not killing Python. This error shouldn't be fatal. Note Numpy's behavior,
Numpy doesn't kill the session when it throws the error. But beyond that, MXNet lacks an For example, pseudocode outlining the shape assertions. def stack(A, B, axis=0):
for i, (s0, s1) in enumerate(zip(A.shape, B.shape)):
if axis != i:
assert A.shape[i] == B.shape[i]
# Actually do the stacking
C = actual_stacking(A, B, axis=axis)
for i, (s0, s1) in enumerate(zip(A.shape, B.shape, C.shape)):
if axis != i:
assert A.shape[i] == B.shape[i]
assert A.shape[i] == C.shape[i]
else:
assert C.shape[i] == A.shape[i] + B.shape[i]
return C |
I see your point. @anirudh2290 is actively working on better support for exception handling in MXNet. He will probably post a design doc for this soon. |
Related to: #7335 |
6 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
full output
This causes the Python environment to exit. A simple non-fatal error message would suffice in this case.
The text was updated successfully, but these errors were encountered: