Hi, Experts,
I am trying to append a tensor to another tensor in pytorch it is: data.append(datum.numpy()) labels.append(label)
In libtorch, I use data.append=datum; labels.append=label1;
And it shows errors . Any comments or suggestions ? Thanks.
append is not a method of the tensor, but a Python list in your example. In C++ you can create a std::vector<Tensor>& tensors and use torch::stack(tensors) instead.
append
list
std::vector<Tensor>& tensors
torch::stack(tensors)
Thanks, that is very helpful