Role of cumsum() in sine sweep generation in torchaudio

As part of audio processing tutorial of torchaudio:
https://pytorch.org/tutorials/beginner/audio_preprocessing_tutorial.html

there is a method written for generating a sine sweep:

def get_sine_sweep(sample_rate, offset=DEFAULT_OFFSET):
max_sweep_rate = sample_rate
freq = _get_log_freq(sample_rate, max_sweep_rate, offset)
delta = 2 * math.pi * freq / sample_rate
cummulative = torch.cumsum(delta, dim=0)
signal = torch.sin(cummulative).unsqueeze(dim=0)
return signal

can someone explain whats the logic of making a cummulative sum of all frequencies before passing them to the sine function?

Just found the answer:

Instantaneous frequency is the derivative of the phase (sine function’s argument). hence to go from instantaneous frequency to phase we integrate, ie. cumsum