Skip to content
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

Fixed a bug in Reshape, where a slice of a slice cannot be reshaped. #359

Merged
merged 1 commit into from Jan 4, 2020

Conversation

@chewxy
Copy link
Member

chewxy commented Jan 4, 2020

This is fixed in two ways:
1. If the input is a View then it is materialized. This
requires more memory, but it is more worth it to allocate than to
stress over calculating how much extra overhead to allocate for
sharing memories
2. ShallowClone is fixed in package tensor to make sure that
views are correctly shallow cloned as well

This is fixed in two ways:
    1. If the input is a `View` then it is materialized. This
    requires more memory, but it is more worth it to allocate than to
    stress over calculating  how much extra overhead to allocate for
    sharing memories
    2. `ShallowClone` is fixed in package `tensor` to make sure that
    views are correctly shallow cloned as well
@chewxy

This comment has been minimized.

Copy link
Member Author

chewxy commented Jan 4, 2020

gorgonia/tensor#56

Additional notes: this fix is a hack. A better fix is to not have to call Materialize, but instead allow for reshaping non-contiguous slices in tensor.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jan 4, 2020

Coverage Status

Coverage decreased (-0.001%) to 63.383% when pulling 323b638 on fixReshapeBug into 1e98951 on master.

@chewxy chewxy merged commit dc9e605 into master Jan 4, 2020
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.