project_name
string
class_name
string
class_modifiers
string
class_implements
int64
class_extends
int64
function_name
string
function_body
string
cyclomatic_complexity
int64
NLOC
int64
num_parameter
int64
num_token
int64
num_variable
int64
start_line
int64
end_line
int64
function_index
int64
function_params
string
function_variable
string
function_return_type
string
function_body_line_type
string
function_num_functions
int64
function_num_lines
int64
outgoing_function_count
int64
outgoing_function_names
string
incoming_function_count
int64
incoming_function_names
string
lexical_representation
string
pytorch_ao
public
public
0
0
_get_pt2e_quantized_linear.__init__
def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(2, 2)
1
3
1
28
0
1,477
1,479
1,477
null
[]
None
null
0
0
0
null
0
null
The function (_get_pt2e_quantized_linear.__init__) defined within the public class called public.The function start at line 1477 and ends at 1479. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
_get_pt2e_quantized_linear.forward
def forward(self, x):return self.linear(x)
1
2
2
14
0
1,481
1,482
1,481
null
[]
None
null
0
0
0
null
0
null
The function (_get_pt2e_quantized_linear.forward) defined within the public class called public.The function start at line 1481 and ends at 1482. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1481.0] and does not return any value..
pytorch_ao
public
public
0
0
_get_pt2e_quantized_linear
def _get_pt2e_quantized_linear(self, is_per_channel=False) -> torch.fx.GraphModule:class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(2, 2)def forward(self, x):return self.linear(x)quantizer = XNNPACKQuantizer()operator_config = get_symmetric_quantization_config(is_per_c...
1
12
2
81
0
1,475
1,491
1,475
null
[]
None
null
0
0
0
null
0
null
The function (_get_pt2e_quantized_linear) defined within the public class called public.The function start at line 1475 and ends at 1491. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1475.0] and does not return any value..
pytorch_ao
public
public
0
0
test_fold_quantize
def test_fold_quantize(self):"""Test to make sure the quantized model gets quantized weight (quantize_per_tensor op is folded)"""m = self._get_pt2e_quantized_linear()node_occurrence = {# quantize op for weight node is foldedns.call_function(torch.ops.quantized_decomposed.quantize_per_tensor.default): 2,ns.call_function...
1
11
1
61
0
1,493
1,505
1,493
null
[]
None
null
0
0
0
null
0
null
The function (test_fold_quantize) defined within the public class called public.The function start at line 1493 and ends at 1505. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_fold_quantize_per_channel
def test_fold_quantize_per_channel(self):"""Test to make sure the quantized model gets quantized weight (quantize_per_channel op is folded)"""m = self._get_pt2e_quantized_linear(is_per_channel=True)node_occurrence = {# quantize op for weight node is foldedns.call_function(torch.ops.quantized_decomposed.quantize_per_ten...
1
14
1
81
0
1,507
1,522
1,507
null
[]
None
null
0
0
0
null
0
null
The function (test_fold_quantize_per_channel) defined within the public class called public.The function start at line 1507 and ends at 1522. It contains 14 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_dont_fold_other_constant.__init__
def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(2, 2)self.dont_fold_me = torch.nn.Parameter(torch.randn(2, 2))
1
4
1
47
0
1,530
1,533
1,530
null
[]
None
null
0
0
0
null
0
null
The function (test_dont_fold_other_constant.__init__) defined within the public class called public.The function start at line 1530 and ends at 1533. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_dont_fold_other_constant.forward
def forward(self, x):t = self.dont_fold_me.t()return self.linear(x) + t
1
3
2
25
0
1,535
1,537
1,535
null
[]
None
null
0
0
0
null
0
null
The function (test_dont_fold_other_constant.forward) defined within the public class called public.The function start at line 1535 and ends at 1537. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1535.0] and does not return any value..
pytorch_ao
public
public
0
0
test_dont_fold_other_constant
def test_dont_fold_other_constant(self):"""Make sure the constant propagation does not apply to things unrelated toquantization"""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(2, 2)self.dont_fold_me = torch.nn.Parameter(torch.randn(2, 2))def forward(self, x):t = sel...
1
20
1
144
0
1,524
1,558
1,524
null
[]
None
null
0
0
0
null
0
null
The function (test_dont_fold_other_constant) defined within the public class called public.The function start at line 1524 and ends at 1558. It contains 20 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_fold_all_ops_before_quantize.__init__
def __init__(self) -> None:super().__init__()self.weight = torch.randn(2, 2)
1
3
1
26
0
1,569
1,571
1,569
null
[]
None
null
0
0
0
null
0
null
The function (test_fold_all_ops_before_quantize.__init__) defined within the public class called public.The function start at line 1569 and ends at 1571. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_fold_all_ops_before_quantize.forward
def forward(self, x):t = self.weight.t()return torch.nn.functional.linear(x, t)
1
3
2
29
0
1,573
1,575
1,573
null
[]
None
null
0
0
0
null
0
null
The function (test_fold_all_ops_before_quantize.forward) defined within the public class called public.The function start at line 1573 and ends at 1575. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1573.0] and does not return any value..
pytorch_ao
public
public
0
0
test_fold_all_ops_before_quantize
def test_fold_all_ops_before_quantize(self):"""Test folding all ops that's before quantized operator:Before:get_attr(weight) -> transpose -> quantize -> dequantizeAfter:get_attr(folded_weight) -> dequantize"""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.weight = torch.randn(2, 2)def forwar...
1
19
1
121
0
1,560
1,592
1,560
null
[]
None
null
0
0
0
null
0
null
The function (test_fold_all_ops_before_quantize) defined within the public class called public.The function start at line 1560 and ends at 1592. It contains 19 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_constant_prop_preserve_metadata.__init__
def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(2, 2)
1
3
1
28
0
1,600
1,602
1,600
null
[]
None
null
0
0
0
null
0
null
The function (test_constant_prop_preserve_metadata.__init__) defined within the public class called public.The function start at line 1600 and ends at 1602. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_constant_prop_preserve_metadata.forward
def forward(self, x):return self.linear(x)
1
2
2
14
0
1,604
1,605
1,604
null
[]
None
null
0
0
0
null
0
null
The function (test_constant_prop_preserve_metadata.forward) defined within the public class called public.The function start at line 1604 and ends at 1605. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1604.0] and does not return any value..
pytorch_ao
public
public
0
0
test_constant_prop_preserve_metadata
def test_constant_prop_preserve_metadata(self):"""Test to make sure the get_attr node for const propagated weight Tensor gets the correctmetadata (from original get_attr node from weight)"""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(2, 2)def forward(self, x):retu...
9
27
1
203
0
1,594
1,631
1,594
null
[]
None
null
0
0
0
null
0
null
The function (test_constant_prop_preserve_metadata) defined within the public class called public.The function start at line 1594 and ends at 1631. It contains 27 lines of code and it has a cyclomatic complexity of 9. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_save_load
def test_save_load(self):"""Test save/load a quantized model"""m = self._get_pt2e_quantized_linear()example_inputs = (torch.randn(2, 2),)ref_res = m(*example_inputs)with TemporaryFileName() as fname:# serializationquantized_ep = torch.export.export(m, example_inputs, strict=True)torch.export.save(quantized_ep, fname)# ...
1
11
1
98
0
1,633
1,647
1,633
null
[]
None
null
0
0
0
null
0
null
The function (test_save_load) defined within the public class called public.The function start at line 1633 and ends at 1647. It contains 11 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_throw.annotate
def annotate(self, gm: torch.fx.GraphModule) -> torch.fx.GraphModule:for n in gm.graph.nodes:n.meta["quantization_annotation"] = None
2
3
2
36
0
1,651
1,653
1,651
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_throw.annotate) defined within the public class called public.The function start at line 1651 and ends at 1653. It contains 3 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1651.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_throw.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
1,655
1,656
1,655
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_throw.validate) defined within the public class called public.The function start at line 1655 and ends at 1656. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1655.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_throw
def test_composable_quantizer_throw(self):class BadQuantizer(Quantizer):def annotate(self, gm: torch.fx.GraphModule) -> torch.fx.GraphModule:for n in gm.graph.nodes:n.meta["quantization_annotation"] = Nonedef validate(self, model: torch.fx.GraphModule) -> None:passquantizer = XNNPACKQuantizer()quantization_config = get...
1
17
1
100
0
1,649
1,670
1,649
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_throw) defined within the public class called public.The function start at line 1649 and ends at 1670. It contains 17 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_transform_for_annotation.transform_for_annotation
def transform_for_annotation(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:# Make a copy of the graph to ensure that we are using the# return value of this function.graph = torch.fx.Graph()graph.graph_copy(model.graph, {})for n in graph.nodes:if n.target == torch.ops.aten.add.Tensor:n.target = torch.ops.at...
3
10
2
88
0
1,674
1,685
1,674
null
[]
None
null
0
0
0
null
0
null
The function (test_transform_for_annotation.transform_for_annotation) defined within the public class called public.The function start at line 1674 and ends at 1685. It contains 10 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1674.0] and does not return any value..
pytorch_ao
public
public
0
0
test_transform_for_annotation.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:return model
1
2
2
21
0
1,687
1,688
1,687
null
[]
None
null
0
0
0
null
0
null
The function (test_transform_for_annotation.annotate) defined within the public class called public.The function start at line 1687 and ends at 1688. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1687.0] and does not return any value..
pytorch_ao
public
public
0
0
test_transform_for_annotation.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
1,690
1,691
1,690
null
[]
None
null
0
0
0
null
0
null
The function (test_transform_for_annotation.validate) defined within the public class called public.The function start at line 1690 and ends at 1691. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1690.0] and does not return any value..
pytorch_ao
public
public
0
0
test_transform_for_annotation.forward
def forward(self, x):return x + 3
1
2
2
11
0
1,694
1,695
1,694
null
[]
None
null
0
0
0
null
0
null
The function (test_transform_for_annotation.forward) defined within the public class called public.The function start at line 1694 and ends at 1695. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1694.0] and does not return any value..
pytorch_ao
public
public
0
0
test_transform_for_annotation
def test_transform_for_annotation(self):class TestQuantizer(Quantizer):def transform_for_annotation(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:# Make a copy of the graph to ensure that we are using the# return value of this function.graph = torch.fx.Graph()graph.graph_copy(model.graph, {})for n in graph...
1
18
1
141
0
1,672
1,707
1,672
null
[]
None
null
0
0
0
null
0
null
The function (test_transform_for_annotation) defined within the public class called public.The function start at line 1672 and ends at 1707. It contains 18 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.transform_for_annotation
def transform_for_annotation(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:for n in model.graph.nodes:if n.target == torch.ops.aten.add.Tensor:n.target = torch.ops.aten.mul.Tensorreturn model
3
7
2
58
0
1,711
1,717
1,711
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.transform_for_annotation) defined within the public class called public.The function start at line 1711 and ends at 1717. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1711.0] and does not retu...
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:return model
1
2
2
21
0
1,719
1,720
1,719
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.annotate) defined within the public class called public.The function start at line 1719 and ends at 1720. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1719.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
1,722
1,723
1,722
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.validate) defined within the public class called public.The function start at line 1722 and ends at 1723. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1722.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.transform_for_annotation
def transform_for_annotation(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:for n in model.graph.nodes:if n.target == torch.ops.aten.add.Tensor:n.target = torch.ops.aten.mul.Tensorreturn model
3
7
2
58
0
1,726
1,732
1,711
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.transform_for_annotation) defined within the public class called public.The function start at line 1726 and ends at 1732. It contains 7 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [1711.0] and does not retu...
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:return model
1
2
2
21
0
1,734
1,735
1,719
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.annotate) defined within the public class called public.The function start at line 1734 and ends at 1735. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1719.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
1,737
1,738
1,722
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.validate) defined within the public class called public.The function start at line 1737 and ends at 1738. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1722.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation.forward
def forward(self, x, y, z):return x + y - z
1
2
4
17
0
1,741
1,742
1,741
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation.forward) defined within the public class called public.The function start at line 1741 and ends at 1742. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [1741.0] and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_transform_for_annotation
def test_composable_quantizer_transform_for_annotation(self):class TestQuantizer1(Quantizer):def transform_for_annotation(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:for n in model.graph.nodes:if n.target == torch.ops.aten.add.Tensor:n.target = torch.ops.aten.mul.Tensorreturn modeldef annotate(self, mode...
1
28
1
222
0
1,709
1,760
1,709
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_transform_for_annotation) defined within the public class called public.The function start at line 1709 and ends at 1760. It contains 28 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_embedding_quantizer
def test_embedding_quantizer(self):m_eager = TestHelperModules.EmbeddingModule().eval()indices = torch.tensor([9,6,5,7,8,8,9,2,8,6,6,9,1,6,8,8,3,2,3,6,3,6,5,7,0,8,4,6,5,8,2,3,])example_inputs = (indices,)quantizer = EmbeddingQuantizer()node_occurrence = {# note: quantize op for weights are const propagatedtorch.ops.qua...
1
62
1
204
0
1,762
1,828
1,762
null
[]
None
null
0
0
0
null
0
null
The function (test_embedding_quantizer) defined within the public class called public.The function start at line 1762 and ends at 1828. It contains 62 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_composable_quantizer_linear_conv
def test_composable_quantizer_linear_conv(self):dynamic_quantizer = XNNPACKQuantizer()quantization_config_dynamic = get_symmetric_quantization_config(is_per_channel=False, is_dynamic=True)dynamic_quantizer.set_global(quantization_config_dynamic)static_quantizer = XNNPACKQuantizer()quantization_config = get_symmetric_qu...
1
46
1
260
0
1,830
1,886
1,830
null
[]
None
null
0
0
0
null
0
null
The function (test_composable_quantizer_linear_conv) defined within the public class called public.The function start at line 1830 and ends at 1886. It contains 46 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_embedding_conv_linear_quantization
def test_embedding_conv_linear_quantization(self):m_eager = TestHelperModules.EmbeddingConvLinearModule().eval()indices = torch.tensor([9,6,5,7,8,8,9,2,8,6,6,9,1,6,8,8,3,2,3,6,3,6,5,7,0,8,4,6,5,8,2,3,])indices = torch.unsqueeze(indices, 0)example_inputs = (indices,)embedding_quantizer = EmbeddingQuantizer()dynamic_quan...
1
87
1
363
0
1,888
1,978
1,888
null
[]
None
null
0
0
0
null
0
null
The function (test_embedding_conv_linear_quantization) defined within the public class called public.The function start at line 1888 and ends at 1978. It contains 87 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
_get_node
def _get_node(self, m: torch.fx.GraphModule, target: torch._ops.OpOverload):"""Return the first node matching the specified target, throwing an exceptionif no such batch norm node is found."""for n in m.graph.nodes:if n.target == target:return nraise ValueError("Did not find node with target ", target)
3
5
3
47
0
1,980
1,988
1,980
null
[]
None
null
0
0
0
null
0
null
The function (_get_node) defined within the public class called public.The function start at line 1980 and ends at 1988. It contains 5 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [1980.0] and does not return any value..
pytorch_ao
public
public
0
0
_test_move_exported_model_dropout.__init__
def __init__(self) -> None:super().__init__()self.dropout = torch.nn.Dropout(0.5, inplace=inplace)
1
3
1
32
0
1,997
1,999
1,997
null
[]
None
null
0
0
0
null
0
null
The function (_test_move_exported_model_dropout.__init__) defined within the public class called public.The function start at line 1997 and ends at 1999. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
_test_move_exported_model_dropout.forward
def forward(self, x):return self.dropout(x)
1
2
2
14
0
2,001
2,002
2,001
null
[]
None
null
0
0
0
null
0
null
The function (_test_move_exported_model_dropout.forward) defined within the public class called public.The function start at line 2001 and ends at 2002. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2001.0] and does not return any value..
pytorch_ao
public
public
0
0
_test_move_exported_model_dropout
def _test_move_exported_model_dropout(self, inplace: bool):"""Test switching dropout behavior between train and eval modes using`move_exported_model_to_eval` and `move_exported_model_to_train` APIs."""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.dropout = torch.nn.Dropout(0.5, inplace=inpl...
2
22
2
202
0
1,990
2,031
1,990
null
[]
None
null
0
0
0
null
0
null
The function (_test_move_exported_model_dropout) defined within the public class called public.The function start at line 1990 and ends at 2031. It contains 22 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [1990.0] and does not return any value..
pytorch_ao
public
public
0
0
test_move_exported_model_dropout
def test_move_exported_model_dropout(self):self._test_move_exported_model_dropout(inplace=False)
1
2
1
13
0
2,033
2,034
2,033
null
[]
None
null
0
0
0
null
0
null
The function (test_move_exported_model_dropout) defined within the public class called public.The function start at line 2033 and ends at 2034. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_move_exported_model_dropout_inplace
def test_move_exported_model_dropout_inplace(self):self._test_move_exported_model_dropout(inplace=True)
1
2
1
13
0
2,036
2,037
2,036
null
[]
None
null
0
0
0
null
0
null
The function (test_move_exported_model_dropout_inplace) defined within the public class called public.The function start at line 2036 and ends at 2037. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
_get_bn_train_eval_ops
def _get_bn_train_eval_ops(self):return (torch.ops.aten.batch_norm.default,torch.ops.aten.batch_norm.default,)
1
5
1
28
0
2,039
2,043
2,039
null
[]
None
null
0
0
0
null
0
null
The function (_get_bn_train_eval_ops) defined within the public class called public.The function start at line 2039 and ends at 2043. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_move_exported_model_bn.__init__
def __init__(self) -> None:super().__init__()self.bn = torch.nn.BatchNorm2d(3)
1
3
1
26
0
2,053
2,055
2,053
null
[]
None
null
0
0
0
null
0
null
The function (test_move_exported_model_bn.__init__) defined within the public class called public.The function start at line 2053 and ends at 2055. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_move_exported_model_bn.forward
def forward(self, x):return self.bn(x)
1
2
2
14
0
2,057
2,058
2,057
null
[]
None
null
0
0
0
null
0
null
The function (test_move_exported_model_bn.forward) defined within the public class called public.The function start at line 2057 and ends at 2058. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2057.0] and does not return any value..
pytorch_ao
public
public
0
0
test_move_exported_model_bn
def test_move_exported_model_bn(self, device):"""Test switching batch_norm behavior between train and eval modes using`move_exported_model_to_eval` and `move_exported_model_to_train` APIs."""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.bn = torch.nn.BatchNorm2d(3)def forward(self, x):retur...
3
22
2
220
0
2,046
2,088
2,046
null
[]
None
null
0
0
0
null
0
null
The function (test_move_exported_model_bn) defined within the public class called public.The function start at line 2046 and ends at 2088. It contains 22 lines of code and it has a cyclomatic complexity of 3. It takes 2 parameters, represented as [2046.0] and does not return any value..
pytorch_ao
public
public
0
0
test_disallow_eval_train
def test_disallow_eval_train(self):m = TestHelperModules.ConvWithBNRelu(relu=True)example_inputs = (torch.rand(3, 3, 5, 5),)# Before export: this is OKm.eval()m.train()# After export: this is not OKm = torch.export.export(m, example_inputs, strict=True).module()with self.assertRaises(NotImplementedError):m.eval()with s...
1
21
1
159
0
2,090
2,118
2,090
null
[]
None
null
0
0
0
null
0
null
The function (test_disallow_eval_train) defined within the public class called public.The function start at line 2090 and ends at 2118. It contains 21 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval.__init__
def __init__(self) -> None:super().__init__()self.bn = torch.nn.BatchNorm2d(3)self.dropout = torch.nn.Dropout(0.5)
1
4
1
40
0
2,125
2,128
2,125
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval.__init__) defined within the public class called public.The function start at line 2125 and ends at 2128. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval.forward
def forward(self, x):x = self.bn(x)x = self.dropout(x)return x
1
4
2
25
0
2,130
2,133
2,130
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval.forward) defined within the public class called public.The function start at line 2130 and ends at 2133. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2130.0] and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval._assert_ops_are_correct
def _assert_ops_are_correct(m: torch.fx.GraphModule, train: bool):targets = [n.target for n in m.graph.nodes]bn_op = bn_train_op if train else bn_eval_opbn_node = self._get_node(m, bn_op)self.assertTrue(bn_node is not None)if TEST_CUDA:self.assertEqual(bn_node.args[5], train)dropout_node = self._get_node(m, torch.ops.a...
4
9
2
103
0
2,144
2,152
2,144
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval._assert_ops_are_correct) defined within the public class called public.The function start at line 2144 and ends at 2152. It contains 9 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [2144.0] and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval
def test_allow_exported_model_train_eval(self):if torch_version_at_least("2.7.0") and TEST_HPU:unittest.SkipTest("test doesn't currently work with HPU")class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.bn = torch.nn.BatchNorm2d(3)self.dropout = torch.nn.Dropout(0.5)def forward(self, x):x = self...
4
45
1
338
0
2,120
2,194
2,120
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval) defined within the public class called public.The function start at line 2120 and ends at 2194. It contains 45 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval_idempotent.__init__
def __init__(self) -> None:super().__init__()self.bn = torch.nn.BatchNorm2d(3)
1
3
1
26
0
2,198
2,200
2,198
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval_idempotent.__init__) defined within the public class called public.The function start at line 2198 and ends at 2200. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval_idempotent.forward
def forward(self, x):x = self.bn(x)return x
1
3
2
17
0
2,202
2,204
2,202
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval_idempotent.forward) defined within the public class called public.The function start at line 2202 and ends at 2204. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2202.0] and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval_idempotent._fake_recompile
def _fake_recompile():m._recompile_count += 1
1
2
0
9
0
2,214
2,215
2,214
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval_idempotent._fake_recompile) defined within the public class called public.The function start at line 2214 and ends at 2215. It contains 2 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_allow_exported_model_train_eval_idempotent
def test_allow_exported_model_train_eval_idempotent(self):class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.bn = torch.nn.BatchNorm2d(3)def forward(self, x):x = self.bn(x)return xm = M().train()example_inputs = (torch.randn(1, 3, 3, 3),)m = torch.export.export(m, example_inputs, strict=True).mo...
1
21
1
157
0
2,196
2,235
2,196
null
[]
None
null
0
0
0
null
0
null
The function (test_allow_exported_model_train_eval_idempotent) defined within the public class called public.The function start at line 2196 and ends at 2235. It contains 21 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_model_is_exported
def test_model_is_exported(self):m = TestHelperModules.ConvWithBNRelu(relu=True)example_inputs = (torch.rand(3, 3, 5, 5),)exported_gm = torch.export.export(m, example_inputs, strict=True).module()fx_traced_gm = torch.fx.symbolic_trace(m, example_inputs)self.assertTrue(torchao.quantization.pt2e.export_utils.model_is_exp...
1
12
1
115
0
2,237
2,248
2,237
null
[]
None
null
0
0
0
null
0
null
The function (test_model_is_exported) defined within the public class called public.The function start at line 2237 and ends at 2248. It contains 12 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_reentrant
def test_reentrant(self):"""Test we can safely call quantization apis multiple times"""m = TestHelperModules.ConvBnReLU2dAndLinearReLU()example_inputs = (torch.randn(3, 3, 10, 10),)quantizer = XNNPACKQuantizer().set_global(get_symmetric_quantization_config(is_per_channel=True, is_qat=True))m.conv_bn_relu = torch.export...
1
49
1
333
0
2,250
2,303
2,250
null
[]
None
null
0
0
0
null
0
null
The function (test_reentrant) defined within the public class called public.The function start at line 2250 and ends at 2303. It contains 49 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_groupwise_per_channel_quant
def test_groupwise_per_channel_quant(self):m = TestHelperModules.GroupwiseConv2d()quantizer = XNNPACKQuantizer()operator_config = get_symmetric_quantization_config(is_per_channel=True)quantizer.set_global(operator_config)example_inputs = m.example_inputs()m = self._quantize(m, quantizer, example_inputs)# make sure it r...
1
8
1
55
0
2,305
2,313
2,305
null
[]
None
null
0
0
0
null
0
null
The function (test_groupwise_per_channel_quant) defined within the public class called public.The function start at line 2305 and ends at 2313. It contains 8 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.quantize_per_tensor_int4
def quantize_per_tensor_int4(input: torch.Tensor,scale: float,zero_point: int,) -> torch.Tensor:inv_scale = 1.0 / scalereturn (torch.clamp(torch.round(input * inv_scale) + zero_point, 0, 15).to(torch.uint8).view(torch.bits8))
1
11
3
65
0
2,319
2,329
2,319
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.quantize_per_tensor_int4) defined within the public class called public.The function start at line 2319 and ends at 2329. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2319.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.dequantize_per_tensor_int4
def dequantize_per_tensor_int4(input: torch.Tensor,scale: float,zero_point: int,) -> torch.Tensor:return (input.view(torch.uint8).to(torch.float32) - zero_point) * scale
1
6
3
44
0
2,332
2,337
2,332
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.dequantize_per_tensor_int4) defined within the public class called public.The function start at line 2332 and ends at 2337. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2332.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.__init__
def __init__(self, *args, **kwargs):# just faking a dtype heresuper().__init__(dtype=torch.int8)
1
2
3
23
0
2,342
2,344
2,342
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.__init__) defined within the public class called public.The function start at line 2342 and ends at 2344. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2342.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.forward
def forward(self, x):return x
1
2
2
9
0
2,346
2,347
2,346
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.forward) defined within the public class called public.The function start at line 2346 and ends at 2347. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2346.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.calculate_qparams
def calculate_qparams(self, **kwargs):pass
1
2
2
9
0
2,349
2,350
2,349
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.calculate_qparams) defined within the public class called public.The function start at line 2349 and ends at 2350. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2349.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.convert
def convert(self, model: torch.fx.GraphModule, observer_node: Node):with model.graph.inserting_before(observer_node):q_node = model.graph.call_function(torch.ops.test_int4.quantize_per_tensor_int4,(observer_node.args[0], 1.0, 0),{},)dq_node = model.graph.call_function(torch.ops.test_int4.dequantize_per_tensor_int4,(q_n...
1
14
3
106
0
2,352
2,365
2,352
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.convert) defined within the public class called public.The function start at line 2352 and ends at 2365. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2352.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:for node in model.graph.nodes:if (node.op == "call_function"and node.target == torch.ops.aten.add.Tensor):input_act0 = node.args[0]assert isinstance(input_act0, Node)input_act1 = node.args[1]assert isinstance(input_act1, Node)act_qspec = Quantizati...
4
26
2
145
0
2,368
2,394
2,368
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.annotate) defined within the public class called public.The function start at line 2368 and ends at 2394. It contains 26 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [2368.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
2,396
2,397
2,396
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.validate) defined within the public class called public.The function start at line 2396 and ends at 2397. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2396.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback.forward
def forward(self, x1, x2):return x1 + x2
1
2
3
13
0
2,400
2,401
2,400
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback.forward) defined within the public class called public.The function start at line 2400 and ends at 2401. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2400.0] and does not return any value..
pytorch_ao
public
public
0
0
test_observer_callback
def test_observer_callback(self):from torch.library import custom_op@custom_op("test_int4::quantize_per_tensor_int4", mutates_args=())def quantize_per_tensor_int4(input: torch.Tensor,scale: float,zero_point: int,) -> torch.Tensor:inv_scale = 1.0 / scalereturn (torch.clamp(torch.round(input * inv_scale) + zero_point, 0,...
1
38
1
196
0
2,315
2,424
2,315
null
[]
None
null
0
0
0
null
0
null
The function (test_observer_callback) defined within the public class called public.The function start at line 2315 and ends at 2424. It contains 38 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_speed.dynamic_quantize_pt2e
def dynamic_quantize_pt2e(model, example_inputs):torch._dynamo.reset()model = torch.export.export(model, example_inputs, strict=True).module()# Per channel quantization for weight# Dynamic quantization for activation# Please read a detail: https://fburl.com/code/30zds51qembedding_quantizer = EmbeddingQuantizer()dynamic...
1
20
2
121
0
2,429
2,457
2,429
null
[]
None
null
0
0
0
null
0
null
The function (test_speed.dynamic_quantize_pt2e) defined within the public class called public.The function start at line 2429 and ends at 2457. It contains 20 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2429.0] and does not return any value..
pytorch_ao
public
public
0
0
test_speed.__init__
def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(5, 5)
1
3
1
28
0
2,460
2,462
2,460
null
[]
None
null
0
0
0
null
0
null
The function (test_speed.__init__) defined within the public class called public.The function start at line 2460 and ends at 2462. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_speed.forward
def forward(self, x):return self.linear(x)
1
2
2
14
0
2,464
2,465
2,464
null
[]
None
null
0
0
0
null
0
null
The function (test_speed.forward) defined within the public class called public.The function start at line 2464 and ends at 2465. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2464.0] and does not return any value..
pytorch_ao
public
public
0
0
test_speed
def test_speed(self):import timedef dynamic_quantize_pt2e(model, example_inputs):torch._dynamo.reset()model = torch.export.export(model, example_inputs, strict=True).module()# Per channel quantization for weight# Dynamic quantization for activation# Please read a detail: https://fburl.com/code/30zds51qembedding_quantiz...
1
9
1
53
0
2,426
2,469
2,426
null
[]
None
null
0
0
0
null
0
null
The function (test_speed) defined within the public class called public.The function start at line 2426 and ends at 2469. It contains 9 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose_bn_relu.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:int8_qspec = QuantizationSpec(dtype=torch.int8,quant_min=-128,quant_max=127,qscheme=torch.per_tensor_symmetric,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_weight_observer,)quantization_config = QuantizationConfig(input_activation=i...
1
16
2
85
0
2,473
2,491
2,473
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose_bn_relu.annotate) defined within the public class called public.The function start at line 2473 and ends at 2491. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2473.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose_bn_relu.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
2,493
2,494
2,493
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose_bn_relu.validate) defined within the public class called public.The function start at line 2493 and ends at 2494. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2493.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose_bn_relu
def test_conv_transpose_bn_relu(self):class BackendAQuantizer(Quantizer):def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:int8_qspec = QuantizationSpec(dtype=torch.int8,quant_min=-128,quant_max=127,qscheme=torch.per_tensor_symmetric,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_wei...
1
23
1
142
0
2,471
2,515
2,471
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose_bn_relu) defined within the public class called public.The function start at line 2471 and ends at 2515. It contains 23 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv3d_bn_relu.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observer,)weight_qspec = QuantizationSpec(dtype=torch.int8,quant_min=-128,quant_ma...
6
53
2
257
0
2,519
2,574
2,519
null
[]
None
null
0
0
0
null
0
null
The function (test_conv3d_bn_relu.annotate) defined within the public class called public.The function start at line 2519 and ends at 2574. It contains 53 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [2519.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv3d_bn_relu.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
2,576
2,577
2,576
null
[]
None
null
0
0
0
null
0
null
The function (test_conv3d_bn_relu.validate) defined within the public class called public.The function start at line 2576 and ends at 2577. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2576.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv3d_bn_relu.__init__
def __init__(self):super().__init__()self.conv = torch.nn.Conv3d(2, 2, 3, padding=1)self.bn = torch.nn.BatchNorm3d(2)
1
4
1
44
0
2,580
2,583
2,580
null
[]
None
null
0
0
0
null
0
null
The function (test_conv3d_bn_relu.__init__) defined within the public class called public.The function start at line 2580 and ends at 2583. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv3d_bn_relu.forward
def forward(self, x):return torch.nn.functional.relu(self.bn(self.conv(x)))
1
2
2
28
0
2,585
2,586
2,585
null
[]
None
null
0
0
0
null
0
null
The function (test_conv3d_bn_relu.forward) defined within the public class called public.The function start at line 2585 and ends at 2586. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2585.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv3d_bn_relu
def test_conv3d_bn_relu(self):class BackendAQuantizer(Quantizer):def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observer,)weight_...
1
27
1
156
0
2,517
2,608
2,517
null
[]
None
null
0
0
0
null
0
null
The function (test_conv3d_bn_relu) defined within the public class called public.The function start at line 2517 and ends at 2608. It contains 27 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose3d_bn_relu.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observer,)weight_qspec = QuantizationSpec(dtype=torch.int8,quant_min=-128,quant_ma...
6
53
2
257
0
2,612
2,667
2,612
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose3d_bn_relu.annotate) defined within the public class called public.The function start at line 2612 and ends at 2667. It contains 53 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [2612.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose3d_bn_relu.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
2,669
2,670
2,669
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose3d_bn_relu.validate) defined within the public class called public.The function start at line 2669 and ends at 2670. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2669.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose3d_bn_relu.__init__
def __init__(self):super().__init__()self.conv_t = torch.nn.ConvTranspose3d(2, 2, 3, padding=1)self.bn = torch.nn.BatchNorm3d(2)
1
4
1
44
0
2,673
2,676
2,673
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose3d_bn_relu.__init__) defined within the public class called public.The function start at line 2673 and ends at 2676. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose3d_bn_relu.forward
def forward(self, x):return torch.nn.functional.relu(self.bn(self.conv_t(x)))
1
2
2
28
0
2,678
2,679
2,678
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose3d_bn_relu.forward) defined within the public class called public.The function start at line 2678 and ends at 2679. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2678.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_transpose3d_bn_relu
def test_conv_transpose3d_bn_relu(self):class BackendAQuantizer(Quantizer):def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observe...
1
27
1
156
0
2,610
2,701
2,610
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_transpose3d_bn_relu) defined within the public class called public.The function start at line 2610 and ends at 2701. It contains 27 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv_padding_bn_relu.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observer,)weight_qspec = QuantizationSpec(dtype=torch.int8,quant_min=-128,quant_ma...
6
53
2
280
0
2,705
2,761
2,705
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_padding_bn_relu.annotate) defined within the public class called public.The function start at line 2705 and ends at 2761. It contains 53 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [2705.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_padding_bn_relu.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
2,763
2,764
2,763
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_padding_bn_relu.validate) defined within the public class called public.The function start at line 2763 and ends at 2764. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2763.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_padding_bn_relu.__init__
def __init__(self):super().__init__()self.conv = test_case["conv_type"](3, 3, 3, padding="same")self.bn = test_case["bn_type"](3)
1
4
1
42
0
2,792
2,795
2,792
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_padding_bn_relu.__init__) defined within the public class called public.The function start at line 2792 and ends at 2795. It contains 4 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_conv_padding_bn_relu.forward
def forward(self, x):return torch.nn.functional.relu(self.bn(self.conv(x)))
1
2
2
28
0
2,797
2,798
2,797
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_padding_bn_relu.forward) defined within the public class called public.The function start at line 2797 and ends at 2798. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2797.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv_padding_bn_relu
def test_conv_padding_bn_relu(self):class BackendAQuantizer(Quantizer):def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observer,)w...
2
48
1
306
0
2,703
2,819
2,703
null
[]
None
null
0
0
0
null
0
null
The function (test_conv_padding_bn_relu) defined within the public class called public.The function start at line 2703 and ends at 2819. It contains 48 lines of code and it has a cyclomatic complexity of 2. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_multi_users_without_output_observer.__init__
def __init__(self) -> None:super().__init__()self.conv = torch.nn.Conv2d(3, 3, 3)
1
3
1
30
0
2,828
2,830
2,828
null
[]
None
null
0
0
0
null
0
null
The function (test_multi_users_without_output_observer.__init__) defined within the public class called public.The function start at line 2828 and ends at 2830. It contains 3 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_multi_users_without_output_observer.forward
def forward(self, x):x = self.conv(x)return x, x + 1
1
3
2
21
0
2,832
2,834
2,832
null
[]
None
null
0
0
0
null
0
null
The function (test_multi_users_without_output_observer.forward) defined within the public class called public.The function start at line 2832 and ends at 2834. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2832.0] and does not return any value..
pytorch_ao
public
public
0
0
test_multi_users_without_output_observer
def test_multi_users_without_output_observer(self):"""Test the case in which a node is used by multiple users,and had its output observer removed."""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.conv = torch.nn.Conv2d(3, 3, 3)def forward(self, x):x = self.conv(x)return x, x + 1example_input...
3
25
1
174
0
2,821
2,860
2,821
null
[]
None
null
0
0
0
null
0
null
The function (test_multi_users_without_output_observer) defined within the public class called public.The function start at line 2821 and ends at 2860. It contains 25 lines of code and it has a cyclomatic complexity of 3. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_prepare_obs_or_fq_callback.forward
def forward(self, x):x = torch.nn.functional.max_pool2d(x, 2, 2)x = torch.nn.functional.pixel_shuffle(x, 2)return x.permute(0, 2, 3, 1)
1
4
2
50
0
2,864
2,867
2,864
null
[]
None
null
0
0
0
null
0
null
The function (test_prepare_obs_or_fq_callback.forward) defined within the public class called public.The function start at line 2864 and ends at 2867. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2864.0] and does not return any value..
pytorch_ao
public
public
0
0
test_prepare_obs_or_fq_callback.annotate
def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qspec = QuantizationSpec(dtype=torch.uint8,quant_min=0,quant_max=255,qscheme=torch.per_tensor_affine,is_dynamic=False,observer_or_fake_quant_ctr=observer.default_observer,)for node in model.graph.nodes:if node.op == "call_function" and node.tar...
4
22
2
151
0
2,870
2,891
2,870
null
[]
None
null
0
0
0
null
0
null
The function (test_prepare_obs_or_fq_callback.annotate) defined within the public class called public.The function start at line 2870 and ends at 2891. It contains 22 lines of code and it has a cyclomatic complexity of 4. It takes 2 parameters, represented as [2870.0] and does not return any value..
pytorch_ao
public
public
0
0
test_prepare_obs_or_fq_callback.validate
def validate(self, model: torch.fx.GraphModule) -> None:pass
1
2
2
16
0
2,893
2,894
2,893
null
[]
None
null
0
0
0
null
0
null
The function (test_prepare_obs_or_fq_callback.validate) defined within the public class called public.The function start at line 2893 and ends at 2894. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2893.0] and does not return any value..
pytorch_ao
public
public
0
0
test_prepare_obs_or_fq_callback.prepare_obs_or_fq_callback
def prepare_obs_or_fq_callback(self,model: torch.fx.GraphModule,edge_or_node_to_obs_or_fq: dict[EdgeOrNode, ObserverOrFakeQuantize],) -> None:# hard code output quant by updating entire sharing groupoutput_node = next(n for n in model.graph.nodes if n.op == "output")output_value = output_node.args[0][0]old_observer = e...
6
21
3
129
0
2,896
2,917
2,896
null
[]
None
null
0
0
0
null
0
null
The function (test_prepare_obs_or_fq_callback.prepare_obs_or_fq_callback) defined within the public class called public.The function start at line 2896 and ends at 2917. It contains 21 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [2896.0] and does not return any value..
pytorch_ao
public
public
0
0
test_prepare_obs_or_fq_callback
def test_prepare_obs_or_fq_callback(self):class Model(torch.nn.Module):def forward(self, x):x = torch.nn.functional.max_pool2d(x, 2, 2)x = torch.nn.functional.pixel_shuffle(x, 2)return x.permute(0, 2, 3, 1)class BackendAQuantizer(Quantizer):def annotate(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:act_qsp...
4
18
1
159
0
2,862
2,930
2,862
null
[]
None
null
0
0
0
null
0
null
The function (test_prepare_obs_or_fq_callback) defined within the public class called public.The function start at line 2862 and ends at 2930. It contains 18 lines of code and it has a cyclomatic complexity of 4. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_preserve_nn_module_stack.check_nn_module
def check_nn_module(node):self.assertTrue("nn_module_stack" in node.meta)self.assertTrue("ConvWithBNRelu" in node.meta["nn_module_stack"]["L__self__"][1])
1
5
1
34
0
2,941
2,945
2,941
null
[]
None
null
0
0
0
null
0
null
The function (test_preserve_nn_module_stack.check_nn_module) defined within the public class called public.The function start at line 2941 and ends at 2945. It contains 5 lines of code and it has a cyclomatic complexity of 1. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_preserve_nn_module_stack
def test_preserve_nn_module_stack(self):"""Test we can preserve nn_module_stack on replaced pattern's nodes"""m = TestHelperModules.ConvBnReLU2dAndLinearReLU()example_inputs = (torch.randn(3, 3, 10, 10),)quantizer = XNNPACKQuantizer().set_global(get_symmetric_quantization_config(is_per_channel=True, is_qat=True))def ch...
5
17
1
138
0
2,932
2,956
2,932
null
[]
None
null
0
0
0
null
0
null
The function (test_preserve_nn_module_stack) defined within the public class called public.The function start at line 2932 and ends at 2956. It contains 17 lines of code and it has a cyclomatic complexity of 5. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_quantize_in_place_ops.set_example_inputs
def set_example_inputs(self, example_inputs):self.example_inputs = example_inputs
1
2
2
12
0
2,962
2,963
2,962
null
[]
None
null
0
0
0
null
0
null
The function (test_quantize_in_place_ops.set_example_inputs) defined within the public class called public.The function start at line 2962 and ends at 2963. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2962.0] and does not return any value..
pytorch_ao
public
public
0
0
test_quantize_in_place_ops.transform_for_annotation
def transform_for_annotation(self, model: torch.fx.GraphModule) -> torch.fx.GraphModule:# Make a copy of the graph to ensure that we are using the# return value of this function.ep = torch.export.export(model, self.example_inputs)ep = ep.run_decompositions({})return ep.module()
1
6
2
48
0
2,965
2,972
2,965
null
[]
None
null
0
0
0
null
0
null
The function (test_quantize_in_place_ops.transform_for_annotation) defined within the public class called public.The function start at line 2965 and ends at 2972. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2965.0] and does not return any value..