| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
With this proposal, the definition of Reshape would be sufficiently restrictive that I think
Also, note that the bit where numpy and the current TensorSpan deviate in #106539 is just a.Reshape(a.Lengths), on which numpy returns a whereas the proposal here would throw an exception, which it should probably not (although maybe there is a reasonable definition of Reshape that doesn't allow it and I just don't see it, see the first bullet point). |
Sorry, something went wrong.
|
@soerenwolfers I am about to push a change that will let a.Reshape(a.Lengths) always work. We will always have some difference between numpy because numpy will allocate new memory behind the scenes if it needs to and we cannot allocate new memory for the TensorSpan. It should work just fine for Tensor though as most operations copy for that in comparison to the TensorSpan where its usually not a copy, so we shouldn't get into the memory situations where a reshape wouldn't work correctly. I agree a TryReshape would be a good thing to have for TensorSpan but not for Tensor. @tannergooding any thoughts on any of this? |
Sorry, something went wrong.
|
/azp run runtime-dev-innerloop |
Sorry, something went wrong.
|
Azure Pipelines successfully started running 1 pipeline(s). |
Sorry, something went wrong.
|
/backport to release/9.0 |
Sorry, something went wrong.
|
Started backporting to release/9.0: https://github.com/dotnet/runtime/actions/runs/11052885500 |
Sorry, something went wrong.
|
@microsoft-github-policy-service rerun |
Sorry, something went wrong.
|
@dotnet-policy-service rerun |
Sorry, something went wrong.
* working * comments from PR * can always reshape to self * fixed tests * comments from PR * fixing tests
| Back | FazBrowse Home | New Git URL |
Fixes #106539, #106537, and #106535.
They all had to go in one PR as they were all connected, but basically fixes Reshape/SetSlice to work with 0 strides. Also adds a few more checks to make sure its ok to Reshape the values.