For sad legacy reasons we have two ways of presenting types, one that matches Python’s typing and our own internal one (which is what you’re seeing), even though the underlying types are the same. The ? here means optional, so int? is equivalent to Optional[int], and the empty prim::Constant() means None.
prim::Constant is a special case 13 in the TorchScript interpreter. Other operators that don’t directly call the underlying torch operators live in register_prim_ops.cpp 15. However, most operators 8 are generated at build time since they just call PyTorch tensor ops and are placed in torch/csrc/jit/generated.