-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when reshaping array #112
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I found some erratic behaviour when using the reshape method.
Basically I parse 3D data out of a binary file and got a 4x512x512 tensor. I then slice it into 4 matrixes 512x512, but the slice function actually returns a 1x512x512 for each slice. I then use reshape on each one to get the data as 2D matrixes.
Here is the debug output, showing the data shape after each operation/iteration:
extracting trace forward/up 0 fluid.spm.js:2970:10
data after scan slice Array(3) [ 1, 512, 512 ]
data after reshape Array [ 512, 512 ]
extracting trace backward/up 1 fluid.spm.js:2970:10
data after scan slice Array(3) [ 1, 512, 512 ]
data after reshape Array [ 512, 512 ]
extracting trace forward/down 2 fluid.spm.js:2970:10
data after scan slice Array(3) [ 1, 512, 512 ]
The first two are reshaped, the last is apparently sliced correctly but gives an error on reshape:
Uncaught TypeError: array is undefined
baseFlatten http://localhost:5000/static/js/numjs.js:24812
baseFlatten http://localhost:5000/static/js/numjs.js:24820
baseFlatten http://localhost:5000/static/js/numjs.js:24820
baseFlatten http://localhost:5000/static/js/numjs.js:24820
flatten http://localhost:5000/static/js/numjs.js:23957
reshape http://localhost:5000/static/js/numjs.js:24042
I also checked the actual tensors after slicing and indeed they appear all fine. Any idea why this happened?
The text was updated successfully, but these errors were encountered: