Adding attribute to a Pytorch Tensor

Hi Everyone!
I noticed at some places that we can add an attribute to a Pytorch Tensor, please see the below example:
a = torch.rand(1,1,3,3)
a.scale=2
a.zeropoint = 128

Curious to understand this functionality and its implications on gradient calculation. Is any official doc available to understand this?
Thanks in advance!

I guess internally the tensor.__setattr__ operation is called to create a new attribute and assign the value to it. I don’t know if it would have any implications besides carrying the data.