When pytorch builtin optimizer loss.backward() could calculate gradient and it is proven correct in its calculation , even though why we need to check derivative computation? Whats wrong in my following code to check derivative computation in back propagation? Or we check gradient computation when we implement gradient computation using our python code not using pytorch loss.backward()?
for epoch in range(num_epochs):
    # forward pass (prediction) and loss
    y_predicted = model(X)
    loss = criterion(y_predicted,y)
    # backward loss
    # calculate the gradients 
    loss.backward()
    # update weights
    optimizer.step()
    
    optimizer.zero_grad()
    
    running_loss +=loss.item()