I’m able to get past this issue using this construct to manually turn the “list of examples” back into a new 3D tensor… but this seems MASSIVELY inefficient. Surely there’s a better way.
    		for (auto& batch : *data_loader) {
			    std::vector<torch::Tensor> Xs_list, Ys_list;
		        std::transform(batch.begin(), batch.end(), std::back_inserter(Xs_list), [](auto &e) {return e.data;});
		        std::transform(batch.begin(), batch.end(), std::back_inserter(Ys_list), [](auto &e) {return e.target;});
			    torch::Tensor X = torch::stack(Xs_list);
			    torch::Tensor Y = torch::stack(Ys_list);
      			optimizer.zero_grad();
      			torch::Tensor prediction = model->forward(X);	
      			torch::Tensor loss = torch::mse_loss(prediction, Y);
....

Edit: previous version of this post tried to use torch::from_blob(list.data(), ..., and was wrong. Changing that to torch::stack() seems to work a lot better.