SciSharp/NumSharp

ToBitmap fails if not contiguous because of Broadcast mismatch

ponzis opened this issue · 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.