Usually the input data doesn’t require gradients and the output of a layer with trainable parameters will require gradients.
Since AutoGradMode was set to true, the result is thus expected.
Here is a small code snippet in Python:
x = torch.randn(1, 1)
print(x.requires_grad)
> False

lin = nn.Linear(1, 1)
out = lin(x)
print(out.requires_grad)
> True

This would be a very simple example of the “standard” use case, where you don’t need to calculate gradients in the input tensor.
As long as you don’t disable the gradient calculation Autograd will create the computation graph (and will thus create outputs with requires_grad=True) for operations using trainable parameters.