NumSharp icon indicating copy to clipboard operation
NumSharp copied to clipboard

ToBitmap fails if not contiguous because of Broadcast mismatch

Open ponzis opened this issue 3 years ago • 0 comments

When using the public static unsafe Bitmap ToBitmap(this NDArray nd, int width, int height, PixelFormat format = PixelFormat.DontCare) passing a NDArray of shape (1, x, y, 3) fails due to broadcast mismatch at (LeftShape, RightShape) = DefaultEngine.Broadcast(lhs.Shape, rhs.Shape); due to broadcasting with (x*y*3) and (1, x, y, 3) the work around is to clone the NDArray so that it is continues or change the shape of the function so that it has a correct shape.

ponzis avatar Feb 09 '22 15:02 ponzis