How to write a inplace operator in extension?

I am trying to write a extension for a operator, which is a in-place operator, let’s take sort_ as example, how to define it in TORCH_LIBRARY ?

The document is confusing, which takes m.def("myadd_out(Tensor a, Tensor b, Tensor(a!) out) -> ()"); as an example, but I do not understand the meaning of a in (a!), does it refer to the first argument? or why this argument needs two name(a and out)?

In the sort_ case, it seems m.def("sort_(Tensor(a!) x) -> ()"); works even we do not have an argument named a, but what is the meaning of (a!) ?