Skip to content

Commit 7e7cba1

Browse files
generatedunixname89002005307016facebook-github-bot
authored andcommitted
suppress errors in executorch
Differential Revision: D47423118 fbshipit-source-id: 79088266b904e67a8db8ae359bb261a1ab78c306
1 parent 44492d1 commit 7e7cba1

File tree

12 files changed

+19
-0
lines changed

12 files changed

+19
-0
lines changed

backends/test/test_backends.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ def forward(self, a, x, b):
279279

280280
# pyre-ignore[16]: Module `executorch.pybindings` has no attribute `portable`.
281281
executorch_module = _load_for_executorch_from_buffer(buff)
282+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
282283
inputs_flattened, _ = tree_flatten(model_inputs)
283284
model_output = executorch_module.run_method("forward", tuple(inputs_flattened))
284285
ref_output = add_mul_module(*model_inputs)
@@ -857,6 +858,7 @@ def forward(self, a, x, b):
857858

858859
# pyre-ignore[16]: Module `executorch.pybindings` has no attribute `portable`.
859860
executorch_module = _load_for_executorch_from_buffer(executorch_prog.buffer)
861+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
860862
inputs_flattened, _ = tree_flatten(inputs)
861863
model_output = executorch_module.run_method("forward", tuple(inputs_flattened))
862864
ref_output = m(*inputs)

backends/vulkan/test/test_vulkan_delegate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def forward(self, *args):
8686
# Test the model with executor
8787
# pyre-ignore
8888
executorch_module = _load_for_executorch_from_buffer(buffer)
89+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
8990
inputs_flattened, _ = tree_flatten(sample_inputs)
9091

9192
model_output = executorch_module.run_method("forward", tuple(inputs_flattened))

backends/xnnpack/test/test_xnnpack_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def forward(self, *args):
220220
# Test the model with executor
221221
# pyre-ignore
222222
executorch_module = _load_for_executorch_from_buffer(buffer)
223+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
223224
inputs_flattened, _ = tree_flatten(sample_inputs)
224225

225226
model_output = executorch_module.run_method("forward", tuple(inputs_flattened))
@@ -422,6 +423,7 @@ def forward(self, x):
422423
buffer = serialize_to_flatbuffer(program)
423424
# pyre-ignore
424425
executorch_module = _load_for_executorch_from_buffer(buffer)
426+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
425427
inputs_flattened, _ = tree_flatten(example_inputs)
426428

427429
model_output = executorch_module.run_method("forward", tuple(inputs_flattened))

bundled_program/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def _tree_flatten(unflatten_data: Any) -> List[ConfigValue]:
151151
Returns:
152152
flatten_data: Flatten data with legal type.
153153
"""
154+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
154155
flatten_data, _ = tree_flatten(unflatten_data)
155156

156157
for data in flatten_data:

bundled_program/tests/test_config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def test_create_config_from_eager_model(self) -> None:
128128

129129
model_outputs = eager_model(*ri)
130130
if isinstance(model_outputs, get_args(DataContainer)):
131+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
131132
flatten_eager_model_outputs = tree_flatten(model_outputs)
132133
else:
133134
flatten_eager_model_outputs = [

exir/emit/_emit_program.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def _emit_prim_getters(prim_getters: Dict[str, Any]) -> List[ExecutionPlan]:
3333
plans = []
3434
# flatten any structures
3535
for method, vals in prim_getters.items():
36+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
3637
flattened_output, spec = ex_pytree.tree_flatten(vals)
3738
spec = spec.to_str()
3839
chain = Chain(

exir/emit/_emitter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,7 @@ def create_container_str(spec: pytree.TreeSpec) -> str:
12581258
# pyre-fixme[16]: `TreeSpec` has no attribute `num_leaves`.
12591259
dummy_leaves = [0] * spec.num_leaves
12601260
tree = torch.utils._pytree.tree_unflatten(dummy_leaves, spec)
1261+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
12611262
_, tree = ex_pytree.tree_flatten(tree)
12621263
return tree.to_str()
12631264

exir/tracer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,14 @@ def __torch_dispatch__(
325325

326326
tensor_args = [
327327
x
328+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
328329
for x in ex_pytree.tree_flatten(args)[0] + ex_pytree.tree_flatten(kwargs)[0]
329330
if isinstance(x, torch.Tensor)
330331
]
331332

333+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_map`.
332334
proxy_args = ex_pytree.tree_map(unwrap_proxy, args)
335+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_map`.
333336
proxy_kwargs = ex_pytree.tree_map(unwrap_proxy, kwargs)
334337

335338
# Get the output of the function

exir/verification/interpreter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ def run(self, *raw_args: torch.Tensor) -> PyTree:
362362
Outputs after completing all computations
363363
"""
364364

365+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
365366
args, pytree = ex_pytree.tree_flatten(raw_args)
366367

367368
if pytree.to_str() != self.container_metatype.encoded_inp_str:
@@ -412,5 +413,7 @@ def run(self, *raw_args: torch.Tensor) -> PyTree:
412413
ip += 1
413414

414415
ret = [self._value_list[i] for i in self.execution_plan.outputs]
416+
# pyre-fixme[16]: Module `pytree` has no attribute `from_str`.
415417
treespec = ex_pytree.from_str(self.container_metatype.encoded_out_str)
418+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_unflatten`.
416419
return ex_pytree.tree_unflatten(ret, treespec)

profiler/test/test_profiler_e2e.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def setUpClass(cls) -> None:
4545
# pyre-ignore: Undefined attribute [16]: Module `executorch.pybindings` has no attribute `portable`.
4646
cls.module = _load_for_executorch_from_buffer(cls.flatbuff_without_stacktrace)
4747

48+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
4849
cls.inputs_flattened, _ = tree_flatten(inputs)
4950
cls.module.run_method("forward", tuple(cls.inputs_flattened))
5051
# pyre-ignore: Undefined attribute [16]: Module `executorch.pybindings` has no attribute `portable`.

pytree/test/test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
# pyre-fixme[11]: Annotation `TreeSpec` is not defined as a type.
1919
def _spec(o: Any) -> TreeSpec:
20+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
2021
_, spec = tree_flatten(o)
2122
return spec
2223

test/end2end/test_end2end.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,10 @@ def wrapper(self: unittest.TestCase) -> None:
562562
expected = getattr(module.eager_module, method)(*inputs)
563563

564564
if do_tree_flatten:
565+
# pyre-fixme[16]: Module `pytree` has no attribute `tree_flatten`.
565566
flatten_inputs, inputs_spec = pytree.tree_flatten(*inputs)
566567
executorch_result = executorch_module.forward([*flatten_inputs])
568+
# pyre-fixme[16]: Module `pytree` has no attribute `TreeSpec`.
567569
executorch_result_unflatten = pytree.TreeSpec.from_str(
568570
program.execution_plan[0].container_meta_type.encoded_out_str
569571
).tree_unflatten(executorch_result)

0 commit comments

Comments
 (0)