Commit 83365b2
Remove RTTI from the Tensor API. Refactor operation handling in the graph.
Remove virtual inheritance from the operation implementations and stop using
side-casting using `dynamic_cast` to find out if an operation is implemented by
a backend.
Add a list of "graph::BackendExtension" elements that can be grafted onto an
operation. Backends implementation of every operation are now implemented by
deriving from this new class. When lowering to a specific backend, we go
through the list of extensions attached to an operation to find a matching
backend.
Backend identification is done by calling `BackendExtension::GetTypeId()`.
As a result of the above changes, operation node implementations don't need to
be defined as templates anymore.
PiperOrigin-RevId: 9149833141 parent ace56b6 commit 83365b2
15 files changed
Lines changed: 932 additions & 776 deletions
File tree
- litert/tensor
- backends/xnnpack
- internal
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
363 | 377 | | |
364 | 378 | | |
365 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | | - | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
0 commit comments