Adds a shape node to 'graph'. graph.inserting_before/after() should be used before the call to decide where to insert the node.
(
graph: torch.fx.Graph,
op_target: EdgeOpOverload,
args: tuple = (),
kwargs: Optional[dict] = None,
from_node: Optional[torch.fx.Node] = None,
)
| 186 | |
| 187 | |
| 188 | def create_shape_node( |
| 189 | graph: torch.fx.Graph, |
| 190 | op_target: EdgeOpOverload, |
| 191 | args: tuple = (), |
| 192 | kwargs: Optional[dict] = None, |
| 193 | from_node: Optional[torch.fx.Node] = None, |
| 194 | ): |
| 195 | """Adds a shape node to 'graph'. |
| 196 | |
| 197 | graph.inserting_before/after() should be used before the call to decide |
| 198 | where to insert the node. |
| 199 | |
| 200 | """ |
| 201 | node = create_node( |
| 202 | graph=graph, |
| 203 | op_target=op_target, |
| 204 | args=args, |
| 205 | kwargs=kwargs, |
| 206 | from_node=from_node, |
| 207 | ) |
| 208 | node.meta[TosaSpecialDtype.meta_key()] = TosaSpecialDtype.SHAPE |
| 209 | return node |
| 210 | |
| 211 | |
| 212 | def insert_q_dq_pair( |
no test coverage detected