Thanks: I’m sure this is where I do it.



 Omroth:

torch::Tensor desired_prediction = torch::empty({get_n_actions()}, torch::requires_grad(false)); 
auto desired_prediction_accessor = desired_prediction.accessor<float,1>();
for (int i = 0; i < get_n_actions(); i ++)
{ 
      desired_prediction_accessor[i] = prediction_accessor[i];
}
desired_prediction_accessor[action_id] = desired_q_score;



How exactly do I set tensor values without modifying in place - compose the data as an array and then initiate a new Tensor with that?
Ian