Closed marty1885 closed 5 years ago
If you extract the code and print the contents.
Tensor a = ones({2, 2});
Tensor d = zeros({2, 3});
std::cout << cat({a, d}, /*dim=*/1) << std::endl;
Tensor sol2 = ones({2, 5});
sol2.view({all(), range(2, 5)}) = 0;
std::cout << sol2 << std::endl;
It prints:
{{ 1, 1, 0, 0, 0},
{ 1, 1, 0, 0, 0}}
{{ 1, 1, 0, 1, 0},
{ 1, 1, 0, 0, 1}}
Looke like we have a bug in the view. That's gonna take a while to debug.
The concat operation test
CHECK( cat({a, d}, 1).isSame(sol2) )
failed with running on a Nvidia card. But works on CPU or Intel iGPU.