'Meaning of stacklevel in PyTorch

I came across many function in PyTorch that have _stacklevel as argument. Here an example of the Softmax modules forward()` method where it is used:

def forward(self, input: Tensor) -> Tensor:
    return F.softmax(input, self.dim, _stacklevel=5)

What does _stacklevel mean? What is it good for?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source