TorchScript currently doesn’t support callables as values (we’re working on supporting it in the coming months). The compiler doesn’t look at the default values at all since it’s not always possible to recover a full type from the default, so if types aren’t specified it just assumes everything is a Tensor. To specify otherwise, you can use Python 3 type hints or mypy style type comments (details 11).
Function attributes on modules is the closest you can get at the moment, so something like
def my_fn(x, some_callable):
    return some_callable(x + 10)

would have to be changed something like to
class M(nn.Module):
    def __init__(self, some_callable):
        self.some_callable = some_callable
    
    def forward(self, x):
        return self.some_callable(x + 10)

torch.jit.script(M(the_function))
torch.jit.script(M(some_other_function))