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

Function _annotate_dropout

backends/example/example_operators/dropout.py:17–34  ·  view source on GitHub ↗

This is what the graph of a simple clone op looks like: fn_weight = self.fn_weight fn_bias = self.fn_bias permute_copy = torch.ops.aten.permute_copy.default(fn_weight, [1, 0]); fn_weight = None addmm = torch.ops.aten.addmm.default(fn_bias, arg2_1, permute_copy); fn_bias = arg2

(partitions, quant_config)

Source from the content-addressed store, hash-verified

15
16
17def _annotate_dropout(partitions, quant_config):
18 """
19 This is what the graph of a simple clone op looks like:
20 fn_weight = self.fn_weight
21 fn_bias = self.fn_bias
22 permute_copy = torch.ops.aten.permute_copy.default(fn_weight, [1, 0]); fn_weight = None
23 addmm = torch.ops.aten.addmm.default(fn_bias, arg2_1, permute_copy); fn_bias = arg2_1 = permute_copy = None
24 """
25 dropout_node = partitions[0].output_nodes[0]
26 input_node = dropout_node.args[0]
27
28 if _nodes_are_annotated([dropout_node]):
29 return
30
31 _annotate_nodes(
32 [(dropout_node, input_node)], quant_config.input_quant_spec, input_node=True
33 )
34 _annotate_nodes([(dropout_node,)], quant_config.output_quant_spec)
35
36
37@dataclass

Callers

nothing calls this directly

Calls 2

_nodes_are_annotatedFunction · 0.90
_annotate_nodesFunction · 0.90

Tested by

no test coverage detected