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

Method named_embed

torch/_dynamo/variables/nn_module.py:439–450  ·  view source on GitHub ↗
(name, obj)

Source from the content-addressed store, hash-verified

437 return ListIteratorVariable(result, mutable_local=MutableLocal())
438
439 def named_embed(name, obj):
440 return TupleVariable(
441 [
442 ConstantVariable.create(name),
443 tx.output.register_attr_or_module(
444 obj,
445 key,
446 name,
447 source=NNModuleSource(gen_source(self.source, name)),
448 ),
449 ]
450 )
451
452 def gen_source(source, name):
453 name_split = name.split(".")

Callers

nothing calls this directly

Calls 4

TupleVariableClass · 0.85
NNModuleSourceClass · 0.85
createMethod · 0.45

Tested by

no test coverage detected