0

guys.

I'm a novice for Python, so, coming here for seeking some answers. My question is what the meaning of "*" and the three dots as following in a python function.

Those codes are placed in the source code of torch. I have this question when I browse those code.

def round(input: Tensor, *, out: Optional[Tensor]=None) -> Tensor: ...

And, there are many code like this, I am wondering for where to read the main code of those function so that I can understand what the function really do?

enter image description here

W Dayu
  • 1
  • You're probably just looking at the type hinting file your IDE provides? The actual implementation is somewhere else, probably in C, not Python. Look at the library's source code repository (probably on Github somewhere). – deceze Nov 26 '21 at 07:55
  • ok, as your suggestion, I find there is a commend in the python code, but I can't find the directory. `# This module is defined in torch/csrc/Module.cpp`. And can you tell me what the meaning of the "*", thank you very much. – W Dayu Nov 26 '21 at 08:21
  • Read the duplicates linked above. – deceze Nov 26 '21 at 09:37

0 Answers0