Are there other parameters that are part of your model that you would like to train? If none of your inputs require grad, it wouldn’t make sense to run backward, because the backward graph wasn’t create in the first place.