MCPcopy Create free account
hub / github.com/pytorch/pytorch / get_kwargs

Method get_kwargs

torch/_dynamo/variables/nn_module.py:415–424  ·  view source on GitHub ↗
(*names)

Source from the content-addressed store, hash-verified

413 raise unimplemented(f"non-const NNModule method {name}")
414
415 def get_kwargs(*names):
416 assert_all_args_kwargs_const()
417 fn = getattr(module, name)
418 bound_args = inspect.signature(fn).bind(
419 *([x.as_python_constant() for x in args]),
420 **{k: v.as_python_constant() for k, v in kwargs.items()},
421 )
422 bound_args.apply_defaults()
423 bound_args = bound_args.arguments
424 return {k: bound_args[k] for k in names}
425
426 def wrap_values(items):
427 result = []

Callers

nothing calls this directly

Calls 4

bindMethod · 0.80
signatureMethod · 0.45
as_python_constantMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected