What is the purpose of GradientTape.watch

By default GradientTape watches every tensor within its context, am I correct?

If so, what is the purpose of GradientTape.watch? Does it mean it will only keep record of the variable specified within watch across iterations of forward pass.

For example, in the attached image below - tape will only keep track of x but NOT y or z? What are the pro/con of using watch?

Hi there,

After a bit of research I found this Tape watch which explains your question. Basically t.watch will ensure to track x variable in case the GradientTape doesn’t include it in its list.

So does that mean in this case tape will NOT watch y and z?

No, it will ensure to watch x as well.