octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51448] cell2mat doesn't preserve dimensions o


From: Hugo Milan
Subject: [Octave-bug-tracker] [bug #51448] cell2mat doesn't preserve dimensions of empty input
Date: Sat, 22 Sep 2018 12:48:40 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Follow-up Comment #2, bug #51448 (project octave):

I recently upgraded my parallel package to the new version that contains this
bug fix. After that, the package stopped working.

Commenting out line 452 of the parcellfun.m fixes the code for me.

To give some context, my algorithm running in parallel outputs matrices (n x
10), where "n" depends on the inputs of the algorithm. Then, this algorithm is
run in parallel with m process using the pararrayfun.m. At the end, I expect
to obtain an output with the dimension (n x 10m), where the outputs from the
different parallel runs are concatenated into the column. So, I expect
pararayfun.m to return me an (n x 10m) matrix. This was working as expected
before I upgraded the parallel package (I believe it was version 3.1.1).

What I observed on my debugging was that, when the code gets in line 452 of
parcellfun.m, varargout{i} already has the output dimension (n x 10m), which
was obtained when running "varargout{i} = cell2mat (res(i, :));" in line 448.
So, it breaks when it runs "varargout{i} = reshape (varargout{i}, shape);" in
line 452 because "size(shape) = [1 m]" and "size(varargout{i}) = [n 10m]",
which means it cannot reshape varargout{i} to [1 m].

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?51448>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]