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

Method encode

devtools/bundled_program/util/test_util.py:53–61  ·  view source on GitHub ↗
(
        self, x: torch.Tensor, q: torch.Tensor, a: int = DEFAULT_INT_INPUT
    )

Source from the content-addressed store, hash-verified

51 self.method_names = ["encode", "decode"]
52
53 def encode(
54 self, x: torch.Tensor, q: torch.Tensor, a: int = DEFAULT_INT_INPUT
55 ) -> torch.Tensor:
56 z = x.clone()
57 torch.mul(self.a, x, out=z)
58 y = x.clone()
59 torch.add(z, self.b, alpha=a, out=y)
60 torch.add(y, q, out=y)
61 return y
62
63 def decode(
64 self, x: torch.Tensor, q: torch.Tensor, a: int = DEFAULT_INT_INPUT

Callers 3

_fetch_imageFunction · 0.45
convert_to_flatbufferFunction · 0.45
_convert_to_flatccFunction · 0.45

Calls 3

cloneMethod · 0.80
mulMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected