1. Official Documentation First, note that scatter_() is an inplace function, meaning that it will change the value of input tensor. The official document scatter_(dim, index, src) → Tensor tells us that parameters include the dim, index tensor, and the source tensor. dim specifies where the index tensor is functioning, and we will…