Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread Pavel Shkadzko via Digitalmars-d-learn
On Sunday, 24 May 2020 at 15:24:14 UTC, 9il wrote: On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote: [...] BTW, the code example above doesn't compiles. OT: Instead of [...] you can generate the same common D array using Mir: auto a = [2, 2, 4].iota!int(1).ndarray;

Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread 9il via Digitalmars-d-learn
On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote: I am confused by the return value of Mir shape. Consider the following example. /// import std.stdio; import std.conv; import std.array: array; import std.range:

Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread Pavel Shkadzko via Digitalmars-d-learn
On Sunday, 24 May 2020 at 14:35:33 UTC, jmh530 wrote: On Sunday, 24 May 2020 at 14:21:26 UTC, Pavel Shkadzko wrote: [snip] Sorry for the typo. It should be "auto arrSlice = a.sliced;" Try using fuse /+dub.sdl: dependency "mir-algorithm" version="*" +/ import std.stdio; import std.conv;

Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread 9il via Digitalmars-d-learn
On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote: I am confused by the return value of Mir shape. Consider the following example. [...] `sliced` returns a view on the array data, a 1-dimensional slice composed of common D arrays. Try to use `fuse` instead of `sliced`.

Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread Pavel Shkadzko via Digitalmars-d-learn
On Sunday, 24 May 2020 at 14:21:26 UTC, Pavel Shkadzko wrote: On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote: I am confused by the return value of Mir shape. Consider the following example. [...] Sorry for the typo. It should be "auto arrSlice = a.sliced;" And another typo

Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread jmh530 via Digitalmars-d-learn
On Sunday, 24 May 2020 at 14:21:26 UTC, Pavel Shkadzko wrote: [snip] Sorry for the typo. It should be "auto arrSlice = a.sliced;" Try using fuse /+dub.sdl: dependency "mir-algorithm" version="*" +/ import std.stdio; import std.conv; import std.array: array; import std.range: chunks; import

Re: Mir Slice.shape is not consistent with the actual array shape

2020-05-24 Thread Pavel Shkadzko via Digitalmars-d-learn
On Sunday, 24 May 2020 at 14:17:33 UTC, Pavel Shkadzko wrote: I am confused by the return value of Mir shape. Consider the following example. [...] Sorry for the typo. It should be "auto arrSlice = a.sliced;"