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

Method __init__

devtools/bundled_program/util/test_util.py:47–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

45 """An example model with multi-methods. Each method has multiple input and single output"""
46
47 def __init__(self) -> None:
48 super().__init__()
49 self.register_buffer("a", 3 * torch.ones(2, 2, dtype=torch.int32))
50 self.register_buffer("b", 2 * torch.ones(2, 2, dtype=torch.int32))
51 self.method_names = ["encode", "decode"]
52
53 def encode(
54 self, x: torch.Tensor, q: torch.Tensor, a: int = DEFAULT_INT_INPUT

Callers 1

__init__Method · 0.45

Calls 2

register_bufferMethod · 0.80
onesMethod · 0.80

Tested by

no test coverage detected