The assignments to ctx are made up and not something PyTorch provides or keeps you from doing. For input and output tensors, it is recommended to use save_for_backward to avoid memory ycles and to check for inplace, but for other purposes we assign to ctx. I don’t know if there is a “save for jvp”, I have not seen it yet.
Best regards
Thomas