absolutely,you assgine your array row by row,but you reshape the row to a (1,-1) like array,I think it will make people confused,however,the syntax is correct and the code can run
torch Tensor slice
you use some confused operator in Tensor operator,your code is like
however, all of them are 2-D tensor,and your id_batch is define as a 2-D array with shape(1,-1),
your first operator is tensor[id_batch] and next operator is tensor[id_batch,:],also they looks like similar,
but because of id_batch is 2-D array,the next operator will add a dim to new tensor,so you use [0] operator to reuce it
if you use a 1-D list as the id_batch,the operator will not produce result which make people confused
finaly,wish you have better work and look forward to your future works!
slice operator
Hello,sir,your model is so excellent which makes me learn a lot. but I have several problems about your code which make me feel confused:
finaly,wish you have better work and look forward to your future works!