Can I change the target in criterion for each iteration?

Can I change the target in the criterion for each iteration?

outputs = net(inputs)
loss = criterion(outputs,outputs+inputs)

Is it possible to update the weights and biases?
or Should I bring the reinforcement learning concept?

Thank you!