Do we need the outer discount term when implementing REINFORCE algorithm I am learning the REINFORCE algorithm, which seems to be a foundation for other algorithms.
I saw the $\gamma^t$ term in Sutton's textbook.

But later when I watch Silver's lecture on this, there's no $\gamma^t$ term.

I read several implementations of the REINFORCE algorithm and seems no one includes this term. (However, when calculating return $G_t$, they do use $\gamma$ to do discounting.)
I am wondering, is it OK to just omit the outer $\gamma^t$ while still using it to calculate the return ($G_t$ or $\text{v}_t$)? Does the outer $\gamma^t$ term have nothing to do with the inner $\gamma^{k-t-1}$ term?
Thanks.
FYI, this is the implementation I studied: https://github.com/pytorch/examples/blob/master/reinforcement_learning/reinforce.py
The answer to your question is already in the text which you copied from Sutton's and Barto's book.
Sutton's and Barto's pseudocode describes the general, discounted, case. While the lecture by Silver talks about the undiscounted case. And in the undiscounted case $\gamma=1$ and therefore $\gamma^t=1$. So you can just omit it. Equation (13.8) in Sutton's and Barto's textbook also provides this simplified equation for the undiscounted case.
Also note that Monte Carlo methods are applied to episodic MDPs only. Therefore, in many cases you might not need the discounted version.