Skip to content

Commit bfe583b

Browse files
cccclaifacebook-github-bot
authored andcommitted
fix the example backend (#664)
Summary: Fix the example backend, rename to ExampleBackend Reviewed By: guangy10 Differential Revision: D50022692
1 parent 78197a3 commit bfe583b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

backends/example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The folder structure incluces:
55
- example_partitioner
66
- example_backend
77
- examples_operators. Assuming all of them can run in the example backend.
8-
- The OpBase defined in op_base.py is just the draft idea, it can be defined more comprehensively depending tosa operator definitions
8+
- The OpBase defined in op_base.py is just the draft idea, it can be defined more comprehensively depending example operator definitions
99
- example_backend_delegate_passes. It includes passes that might be helpful in the backend. Right now there are two passes: merge_to_dim_pass.py and permute_memory_formats_pass.py. They are examples to show how to represent memory format permutation and how to represent operators with different memory format (like channel last)
1010
- merge_to_dim_pass.py only handles one merging cases. More cases need to be covered but should be straitforward.
1111

backends/example/example_backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323

2424

2525
@final
26-
class TosaBackend(BackendDetails):
26+
class ExampleBackend(BackendDetails):
2727
@staticmethod
2828
def preprocess(
2929
edge_program: ExportedProgram,
3030
compile_specs: List[CompileSpec],
3131
) -> PreprocessResult:
32-
print("entering the lowerable parts in TosaBackend.preprocess....")
32+
print("entering the lowerable parts in ExampleBackend.preprocess....")
3333

3434
copy_edge_program = copy.deepcopy(edge_program)
3535
copy_edge_program._transform(

backends/example/example_partitioner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from typing import Dict, final
88

99
import torch
10-
from executorch.backends.example.example_backend import TosaBackend
10+
from executorch.backends.example.example_backend import ExampleBackend
1111
from executorch.backends.example.example_operators.ops import module_to_annotator
1212
from executorch.exir.backend.canonical_partitioners.pattern_op_partitioner import (
1313
generate_partitions_from_list_of_nodes,
@@ -32,7 +32,7 @@ class ExamplePartitioner(Partitioner):
3232

3333
def __init__(self) -> None:
3434
self.patterns = module_to_annotator.keys()
35-
self.delegation_spec = DelegationSpec(TosaBackend.__name__, [])
35+
self.delegation_spec = DelegationSpec(ExampleBackend.__name__, [])
3636

3737
class DequantQuantOperatorSupport(OperatorSupportBase):
3838
def is_node_supported(self, _submodules, node: torch.fx.Node) -> bool:

0 commit comments

Comments
 (0)