In terms of exact functionality of Autograd it’d best to get a Dev’s opinion (as they know what’s exactly going on), but what I would say from purely a mathematical perspective is that the gradient of a given operation is defined by the chain rule.
So it’s essentially a product of all intermediate gradients from a given layer (e.g. your torch.tensor function) up to the final layer (where you compute your loss value). So, if one of those intermediate gradients between these 2 layers is 0 (from not having a grad_fn) then all preceding layers (i.e. all layers before your torch.tensor layer) will have a zero-valued gradient by definition.