Now Tensor::reshape() supports unknown dimensions denoted with -1. With basically the same behavior as NumPy.
Ex:
auto a = ones({4, 4});
a = a.reshape({-1, 8}); // Solves as {2, 8} automatically
a = a.reshape({-1, 7}); // Throws. Cannot divide the elements
a = a.reshape({-1, -1, 8}); // Throws. Too many unknown
Like reshape(), resize() also supports solving unknowns.
Now Tensor::reshape() supports unknown dimensions denoted with -1. With basically the same behavior as NumPy.
Ex:
Like
reshape()
,resize()
also supports solving unknowns.