GithubHelp home page GithubHelp logo

Comments (5)

visr avatar visr commented on June 3, 2024

The UndefVarError is fixed in #272, but that doesn't fix this issue, which I also ran into. Now your first example gives:

x = VectorOfArray([randn(2) for _ in 1:4]);
reshape(x, :)
# -> DimensionMismatch: parent has 8 elements, which is incompatible with size (4,)

This is related to the somewhat odd situation that length(x) == 4 and size(x) == (2,4), i.e. it seems to behave like both a vector and a matrix, but x isa AbstractMatrix.

The function vec according to the Base docs should return the same underlying data, but vec(x) creates a copy.

For my 1D example I could use reshape(x, prod(size(x))) as a workaround.

from recursivearraytools.jl.

sethaxen avatar sethaxen commented on June 3, 2024

it seems to behave like both a vector and a matrix, but x isa AbstractMatrix.

For me this is a deal-breaker. I want one or the other. It's easy for me to create a vector of vectors, but I explicitly want to use this type to treat those as an AbstractMatrix.

from recursivearraytools.jl.

ChrisRackauckas avatar ChrisRackauckas commented on June 3, 2024

yeah and that would be changed if someone has a good way to do it.

from recursivearraytools.jl.

AayushSabharwal avatar AayushSabharwal commented on June 3, 2024

This works now. I think the issue can be closed?

from recursivearraytools.jl.

sethaxen avatar sethaxen commented on June 3, 2024

Indeed, reshape(::VectorOfArray, ::Any...) was redefined in #290, and this now works.

from recursivearraytools.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.