You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider the following code which intends to put the diagonal of a rank 4 tensor into a rank 2 tensor:
auto t4 = makes_a_rank_4_tensor();
auto t2 = makes_uninitialized_rank_2_tensor();
for(auto itr = t2.begin(); itr != t2.end(); ++itr){
auto ij = itr.index();
// Bug because user unintentionally copies the range and not just the data
t2.set(ij, t4.find({ij[0], ij[1], ij[0], ij[1]}));
}
This actually compiles and "works" (the resulting tensor can be printed, but results in errors in most other circumstances since the tensor is rank 2, but has rank 4 tiles). I think set should raise an error in this scenario. Not a pressing issue, but wanted to make a note of it before I forgot.
The text was updated successfully, but these errors were encountered:
Consider the following code which intends to put the diagonal of a rank 4 tensor into a rank 2 tensor:
This actually compiles and "works" (the resulting tensor can be printed, but results in errors in most other circumstances since the tensor is rank 2, but has rank 4 tiles). I think
set
should raise an error in this scenario. Not a pressing issue, but wanted to make a note of it before I forgot.The text was updated successfully, but these errors were encountered: