The triplet loss example in documentation is as follows:
input1 = torch.randn(100, 128, requires_grad=True)
input2 = torch.randn(100, 128, requires_grad=True)
input3 = torch.randn(100, 128, requires_grad=True)
output = triplet_loss(input1, input2, input3)
output.backward()

When I check the value of input1.grad, it is coming to be None. Same for input2 and input3.
Is this as expected? If so, why is requires_grad=True needed in the tensor?
Thanks