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

Function is_mutable_buffer_input

backends/qualcomm/builders/utils.py:78–89  ·  view source on GitHub ↗

Check if the given tensor is a mutable buffer input Args: tensor: EdgeIR Tensor that is being checked for mutable buffer input

(
    tensor: torch.fx.Node, edge_program: torch.export.ExportedProgram
)

Source from the content-addressed store, hash-verified

76
77
78def is_mutable_buffer_input(
79 tensor: torch.fx.Node, edge_program: torch.export.ExportedProgram
80) -> bool:
81 """
82 Check if the given tensor is a mutable buffer input
83 Args:
84 tensor: EdgeIR Tensor that is being checked for mutable buffer input
85 """
86 if tensor.op == "placeholder" and is_buffer(edge_program, tensor):
87 fqn = edge_program.graph_signature.inputs_to_buffers[tensor.target]
88 # if the buffer is mutated then record that
89 return fqn in edge_program.graph_signature.buffers_to_mutate.values()
90
91
92def is_graph_output(node: torch.fx.Node) -> bool:

Callers 4

_insertMethod · 0.90
get_tensor_typeMethod · 0.85
get_tensor_nameMethod · 0.85

Calls 1

valuesMethod · 0.80

Tested by

no test coverage detected