@ptrblck thanks , could you please share a simple code for writing custom autograd functions?
Still i am not clear if i write following code framework to train neural network then how could it be break? Calculating gradients loss.backward and update weights optimizer.step are builtin in pytorch how come it will break? Are you talking about changes made by pytroch team within new package/release of pytorch?
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()