@torch.jit.script can be used as a decorator on functions to script them. So, these two code snippets are roughly equivalent:
Decorator
@torch.jit.script
def fn(a: int):
   return a + 1

fn(3) # fn here is a scripted function

Function Call
def fn(a: int):
   return a + 1

s_fn = torch.jit.script(fn)
s_fn(3) # s_fn here is a scripted function

This decorator can also be used on classes that extend object to script them (known as Torchscript classes 33).
Because only instances of Modules can be scripted, @torch.jit.script cannot be used as a decorator on a subclass of Module. You must create an instance of the Module and pass it to torch.jit.script in order to script it.