def discount_bootstrap(rewards_buffer, dones_buffer, final_values, discount_factor, number_of_steps):
true_value_buffer = torch.zeros_like(rewards_buffer)<EOL>current_value = final_values<EOL>for i in reversed(range(number_of_steps)):<EOL><INDENT>current_value = rewards_buffer[i] + discount_factor * current_value * (<NUM_LIT:1.0> - dones_buffer[i])<EOL>true_value_buffer[i] = current_value<EOL><DEDENT>return true_value_buffer<EOL>
Calculate state values bootstrapping off the following state values