torchoutil.pyoutil.inspect module¶
- get_argnames(
- fn: Callable,
Get arguments names of a method, function or callable object.
- get_fullname( ) str[source]¶
Returns the classname of an object with parent modules.
- Args:
obj: Object to scan. inst_suffix: Suffix appended to the classname in case the object is an instance of a class.
Example 1¶
>>> get_fullname([0, 1, 2]) ... 'builtins.list(...)' >>> get_fullname(1.0) ... 'builtins.float(...)' >>> class A: def f(self): return 0 >>> a = A() >>> get_fullname(a) ... '__main__.A(...)' >>> get_fullname(A) ... '__main__.A' >>> get_fullname(a.f) ... '__main__.A.f' >>> get_fullname(A.f) ... '__main__.A.f'