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

Method test_fp8_tensor_conversion

exir/tests/test_tensor.py:94–100  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

92 # (3*4*5, 1, 5*3, 3))
93
94 def test_fp8_tensor_conversion(self) -> None:
95 for dtype in (torch.float8_e5m2, torch.float8_e4m3fn):
96 normal_tensor = torch.randn(2, 2, 3, dtype=torch.float32).to(dtype)
97 flatbuffer_tensor = make_tensor_value(
98 1, 0, TensorSpec.from_tensor(normal_tensor)
99 )
100 self.compare_tensors(normal_tensor, flatbuffer_tensor)
101
102 def test_allocation_info_succeeds(self) -> None:
103 test_cases = (

Callers

nothing calls this directly

Calls 4

compare_tensorsMethod · 0.95
make_tensor_valueFunction · 0.90
toMethod · 0.45
from_tensorMethod · 0.45

Tested by

no test coverage detected