I have a list like
xs = [tensor1, tensor2, tensor3....]
I want to change it into a tensor so that I can feed xs and ys into the Pytorch DataLoader. I tried this,
xs = torch.Tensor(xs)
but it doesn't work as the individual elements are not items but tensors.
You may want torch.stack
xs = torch.stack(xs)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With