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

Method remap_input

torch/_export/unflatten.py:442–452  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

440 self.node_to_placeholder[x] = placeholder_node
441
442 def remap_input(self, x):
443 assert x.graph is self.flat_graph
444 if x in self.node_map:
445 return self.node_map[x]
446 if x not in self.node_to_placeholder:
447 self.add_placeholder(x)
448 if self.parent_call_module is not None:
449 # Important to *prepend* the output to match how we are
450 # inserting placeholder nodes.
451 self.parent_call_module.insert_arg(0, self.parent.remap_input(x))
452 return self.node_to_placeholder[x]
453
454 def finalize_outputs(self):
455 orig_outputs = []

Callers 1

__init__Method · 0.80

Calls 2

add_placeholderMethod · 0.95
insert_argMethod · 0.80

Tested by

no test coverage detected