broadcasted slice. For example, when a has its shape [a, 1] and b has [1, b], this function returns expanded a and b with a broadcasted shape [a, b].
1 import mir.ndslice; 2 auto a = iota(1, 3, 1); 3 auto b = iota(1, 1, 2); 4 auto x = broadcast(a, b); 5 assert(broadcast(a, b)[0] == a.expand!2(2)); 6 assert(broadcast(a, b)[1] == b.expand!1(3));