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

Method insert_input_spec

backends/test/program_builder.py:53–67  ·  view source on GitHub ↗
(
        self, target: str, input_kind: InputKind, value: Tensor
    )

Source from the content-addressed store, hash-verified

51 super().__init__(fake_tensor_mode=fake_tensor_mode)
52
53 def insert_input_spec(
54 self, target: str, input_kind: InputKind, value: Tensor
55 ) -> None:
56 persistent: Optional[bool] = None
57 if input_kind == InputKind.BUFFER:
58 persistent = True
59 self.input_specs.append(
60 InputSpec(
61 input_kind, TensorArgument(target), target=target, persistent=persistent
62 )
63 )
64 if input_kind == InputKind.PARAMETER or input_kind == InputKind.BUFFER:
65 self.state_dict[target] = value
66 elif input_kind == InputKind.CONSTANT_TENSOR:
67 self.constants[target] = value
68
69 def placeholder(
70 self,

Callers 1

placeholderMethod · 0.95

Calls 3

InputSpecClass · 0.85
TensorArgumentClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected