MCPcopy Create free account
hub / github.com/pytorch/executorch / wrap

Method wrap

exir/tracer.py:509–518  ·  view source on GitHub ↗
(arg: Value, i: int)

Source from the content-addressed store, hash-verified

507 # Wrap all inputs as a PythonTensor subclass and insert them into the FX
508 # graph as placeholder nodes
509 def wrap(arg: Value, i: int) -> Value:
510 placeholder = self.create_proxy("placeholder", f"ph_{i}", (), {})
511 if isinstance(arg, torch.Tensor):
512 return PythonTensor(arg, placeholder, is_immutable=True)
513 else:
514 # torch._assert(
515 # placeholder == arg,
516 # f"ph_{i} has been specialized to have value {arg}",
517 # )
518 return arg
519
520 tree_args = [wrap(arg, i) for i, arg in enumerate(concrete_args)]
521 if in_spec:

Callers 4

print_wrappedFunction · 0.80
toByteArrayMethod · 0.80
fromByteArrayMethod · 0.80
fromByteArrayMethod · 0.80

Calls 1

PythonTensorClass · 0.85

Tested by

no test coverage detected