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
forward
def forward(self, x):if self.inplace_add:tmp = self.linear(x)tmp += self.linear2(tmp)return tmpelse:tmp = self.linear(x)return tmp + self.linear2(tmp)
2
8
2
49
0
466
473
466
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 466 and ends at 473. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [466.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,inplace_add: bool = False,) -> None:super().__init__()self.conv = torch.nn.Conv2d(in_channels=3, out_channels=3, kernel_size=3, stride=1, padding=1)self.conv2 = torch.nn.Conv2d(in_channels=3, out_channels=3, kernel_size=3, stride=1, padding=1)self.inplace_add = inplace_addself.bn = torch.nn.BatchNorm2...
1
14
2
110
0
476
489
476
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 476 and ends at 489. It contains 14 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [476.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):if self.inplace_add:tmp = self.bn(self.conv(x))tmp += self.bn2(self.conv2(tmp))return tmpelse:tmp = self.bn(self.conv(x))return tmp + self.bn2(self.conv2(tmp))
2
8
2
69
0
491
498
491
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 491 and ends at 498. It contains 8 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [491.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,input_dim,transpose_for_score=False,num_attention_heads=None,attention_head_size=None,) -> None:super().__init__()self.input_dim = input_dimself.q_proj = nn.Linear(input_dim, input_dim, bias=False)self.k_proj = nn.Linear(input_dim, input_dim, bias=False)self.v_proj = nn.Linear(input_dim, input_dim, bi...
2
19
5
125
0
501
519
501
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 501 and ends at 519. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [501.0] and does not return any value..
pytorch_ao
public
public
0
0
transpose_for_scores
def transpose_for_scores(self, x: torch.Tensor) -> torch.Tensor:new_x_shape = x.size()[:-1] + (self.num_attention_heads,self.attention_head_size,)x = x.view(new_x_shape)return x.permute(0, 2, 1, 3)
1
7
2
59
0
521
527
521
null
[]
None
null
0
0
0
null
0
null
The function (transpose_for_scores) defined within the public class called public.The function start at line 521 and ends at 527. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [521.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):q = self.q_proj(x)k = self.k_proj(x)v = self.v_proj(x)if self.transpose_for_score:q = self.transpose_for_scores(q)k = self.transpose_for_scores(k)v = self.transpose_for_scores(v)scores = torch.matmul(q, k.transpose(-1, -2)) / (self.input_dim**0.5)attention = self.softmax(scores)weighted = torch.mat...
2
12
2
109
0
529
540
529
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 529 and ends at 540. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [529.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 16, 7, bias=True, stride=2, padding=3, dilation=1)self.relu = torch.nn.ReLU()
1
6
1
56
0
543
548
299
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 543 and ends at 548. It contains 6 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
forward
def forward(self, pixel_values):embeddings = self.projection(pixel_values).flatten(2).transpose(1, 2)embeddings = torch.cat((self.cls_token, embeddings), dim=1)return embeddings
1
4
2
47
0
550
553
550
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 550 and ends at 553. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [550.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self):super().__init__()self.conv = torch.nn.Conv2d(3, 768, kernel_size=(16, 16), stride=(16, 16))
1
3
1
42
0
556
558
556
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 556 and ends at 558. 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
forward
def forward(self, x):x = self.conv(x)if self.with_bn:x = self.bn(x)x = self.post_op(x)x = self.maxpool(x)return x
1
4
2
46
0
560
563
72
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 560 and ends at 563. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [72.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,inplace_add: bool = False,linear_pos: NodePosType = NodePosType.left,inplace_relu: bool = False,use_bias: bool = False,) -> None:super().__init__()self.linear = torch.nn.Linear(in_features=16, out_features=16, bias=use_bias)self.linear2 = torch.nn.Linear(in_features=16, out_features=16, bias=use_bias)...
1
22
5
116
0
567
588
393
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 567 and ends at 588. It contains 22 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [393.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):identity = xout = self.conv1(x)out = self.bn1(out)out = self.relu(out)out = self.conv2(out)out = self.bn2(out)if self.downsample is not None:identity = self.downsample(x)out += identityout = self.relu(out)return out
2
12
2
79
0
590
606
590
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 590 and ends at 606. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [590.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self, num_classes=10):super().__init__()self.in_channels = 16self.conv1 = nn.Conv2d(3, self.in_channels, kernel_size=3, stride=1, padding=1, bias=False)self.bn1 = nn.BatchNorm2d(self.in_channels)self.relu = nn.ReLU()self.layer1 = self._make_layer(16, 1)self.layer2 = self._make_layer(32, 1, stride=2)self.la...
1
13
2
142
0
608
620
608
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 608 and ends at 620. It contains 13 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [608.0] and does not return any value..
pytorch_ao
public
public
0
0
_make_layer
def _make_layer(self, out_channels, blocks, stride=1):downsample = Noneif stride != 1 or self.in_channels != out_channels:downsample = nn.Sequential(nn.Conv2d(self.in_channels,out_channels,kernel_size=1,stride=stride,bias=False,),nn.BatchNorm2d(out_channels),)layers = []layers.append(self.BasicBlock(self.in_channels, o...
4
21
4
126
0
622
644
622
null
[]
None
null
0
0
0
null
0
null
The function (_make_layer) defined within the public class called public.The function start at line 622 and ends at 644. It contains 21 lines of code and it has a cyclomatic complexity of 4. It takes 4 parameters, represented as [622.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):x = self.conv1(x)x = self.bn1(x)x = self.relu(x)x = self.layer1(x)x = self.layer2(x)x = self.layer3(x)x = self.avgpool(x)x = torch.flatten(x, 1)x = self.fc(x)return x
1
11
2
83
0
646
659
646
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 646 and ends at 659. It contains 11 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [646.0] and does not return any value..
pytorch_ao
public
public
0
0
_test_quantizer
def _test_quantizer(self,model,example_inputs,quantizer,expected_node_occurrence,expected_node_list=None,is_qat=False,debug=False,lower=False,):m_eager = model.train() if is_qat else model.eval()# program capturem = copy.deepcopy(m_eager)m = torch.export.export(m, example_inputs, strict=True).module()# QAT Model failed...
9
35
9
219
0
663
702
663
null
[]
None
null
0
0
0
null
0
null
The function (_test_quantizer) defined within the public class called public.The function start at line 663 and ends at 702. It contains 35 lines of code and it has a cyclomatic complexity of 9. It takes 9 parameters, represented as [663.0] and does not return any value..
pytorch_ao
public
public
0
0
test_conv2d
def test_conv2d(self):"""Test pattern of single conv2d with X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.SingleConv2dModule().eval()example_inputs = (torch.randn(2, 3, 16, 16),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization...
1
25
1
161
0
709
738
709
null
[]
None
null
0
0
0
null
0
null
The function (test_conv2d) defined within the public class called public.The function start at line 709 and ends at 738. It contains 25 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_conv2d_unary
def test_conv2d_unary(self):"""Test pattern of conv2d with unary post ops (such as relu, hardtanh, hardswish, relu6) with X86InductorQuantizer."""unary_map = {"relu": [torch.nn.ReLU(inplace=False), torch.ops.aten.relu.default],"relu_inplace": [torch.nn.ReLU(inplace=True), torch.ops.aten.relu_.default],"hardtanh": [torc...
2
62
1
489
0
741
807
741
null
[]
None
null
0
0
0
null
0
null
The function (test_conv2d_unary) defined within the public class called public.The function start at line 741 and ends at 807. It contains 62 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_conv2d_binary
def test_conv2d_binary(self):"""Test pattern of conv2d with binary post ops (such as add) with X86InductorQuantizer.Currently, only add as binary post op is supported."""conv2d_type_list = [NodePosType.left, NodePosType.both]example_inputs = (torch.randn(2, 3, 6, 6),)quantizer = X86InductorQuantizer().set_global(xiq.ge...
3
36
1
251
0
810
857
810
null
[]
None
null
0
0
0
null
0
null
The function (test_conv2d_binary) defined within the public class called public.The function start at line 810 and ends at 857. It contains 36 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_conv2d_binary2
def test_conv2d_binary2(self):"""Test Pattern:tmp = conv2d_1(x)tmp2 = conv2d_2(tmp)return tmp + tmp2Since conv2d_1 has 2 users, we should annotate conv2d_2 for binary fusion instead of conv2d_1"""example_inputs = (torch.randn(2, 3, 6, 6),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quanti...
3
33
1
210
0
860
900
860
null
[]
None
null
0
0
0
null
0
null
The function (test_conv2d_binary2) defined within the public class called public.The function start at line 860 and ends at 900. It contains 33 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_conv2d_binary_unary
def test_conv2d_binary_unary(self):"""Test pattern of conv2d with binary + unary post ops (such as add + relu) with X86InductorQuantizer.Currently, only add as binary post op and relu as unary post op are supported."""conv2d_type_list = [NodePosType.left, NodePosType.both]example_inputs = (torch.randn(2, 3, 6, 6),)quan...
3
38
1
252
0
903
952
903
null
[]
None
null
0
0
0
null
0
null
The function (test_conv2d_binary_unary) defined within the public class called public.The function start at line 903 and ends at 952. It contains 38 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_conv2d_serials_binary_unary
def test_conv2d_serials_binary_unary(self):"""Test pattern of 2 following up conv2d add relu with X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.SerialsConv2dAddReLUModule().eval()example_inputs = (torch.randn(2, 3, 16, 16),)quantizer = X86InductorQuantizer().set_gl...
1
31
1
221
0
955
989
955
null
[]
None
null
0
0
0
null
0
null
The function (test_conv2d_serials_binary_unary) defined within the public class called public.The function start at line 955 and ends at 989. It contains 31 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
_single_op_share_observer_recipe_test_helper
def _single_op_share_observer_recipe_test_helper(self, m, x, single_op):quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization_config())example_inputs = (x,)node_occurrence = {# one for input and weight of the conv, two for input/output for the maxpool2dtorch.ops.quantized_decomposed.qu...
6
48
4
329
0
991
1,041
991
null
[]
None
null
0
0
0
null
0
null
The function (_single_op_share_observer_recipe_test_helper) defined within the public class called public.The function start at line 991 and ends at 1041. It contains 48 lines of code and it has a cyclomatic complexity of 6. It takes 4 parameters, represented as [991.0] and does not return any value..
pytorch_ao
public
public
0
0
test_maxpool2d_recipe
def test_maxpool2d_recipe(self):r"""Test pattern: int8_in_int8_out_ops(maxpool) - non_quantizable op(pow)Since maxpool is a int8_in_int8_out_op, there is obs between maxpool and pow."""self._single_op_share_observer_recipe_test_helper(TestHelperModules.Conv2dSingleOpPowModule(nn.MaxPool2d(1, 1)).eval(),torch.rand(1, 2,...
1
6
1
53
0
1,044
1,053
1,044
null
[]
None
null
0
0
0
null
0
null
The function (test_maxpool2d_recipe) defined within the public class called public.The function start at line 1044 and ends at 1053. It contains 6 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_adaptive_avg_pool2d_recipe
def test_adaptive_avg_pool2d_recipe(self):r"""Test pattern: int8_in_int8_out_ops(adaptive_avg_pool2d) - non_quantizable op(pow)Since adaptive_avg_pool2d is a int8_in_int8_out_op, there is obs between adaptive_avg_pool2d and pow."""self._single_op_share_observer_recipe_test_helper(TestHelperModules.Conv2dSingleOpPowModu...
1
8
1
55
0
1,056
1,067
1,056
null
[]
None
null
0
0
0
null
0
null
The function (test_adaptive_avg_pool2d_recipe) defined within the public class called public.The function start at line 1056 and ends at 1067. 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_flatten_recipe
def test_flatten_recipe(self):r"""Test pattern: conv -> flatten -> cat -> transpose"""m = TestHelperModules.Conv2dFlattenCatTranspose().eval()x = torch.randn(1, 3, 224, 224)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization_config())example_inputs = (x,)node_occurrence = {torch.ops....
6
56
1
398
0
1,070
1,130
1,070
null
[]
None
null
0
0
0
null
0
null
The function (test_flatten_recipe) defined within the public class called public.The function start at line 1070 and ends at 1130. It contains 56 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_flatten_recipe2
def test_flatten_recipe2(self):r"""Test pattern: conv -> flatten -> transpose"""m = TestHelperModules.Conv2dFlattenTranspose().eval()x = torch.randn(1, 3, 224, 224)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization_config())example_inputs = (x,)node_occurrence = {torch.ops.quantized...
1
27
1
173
0
1,133
1,163
1,133
null
[]
None
null
0
0
0
null
0
null
The function (test_flatten_recipe2) defined within the public class called public.The function start at line 1133 and ends at 1163. 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_cat_recipe
def test_cat_recipe(self):r"""Test pattern: conv -> cat -> maxpool2dSince cat, maxpool is a int8_in_int8_out_op, the inputs and outputs should with same observer."""m = TestHelperModules.Conv2dCatMaxpool2d().eval()x = torch.randn(16, 3, 16, 16).contiguous(memory_format=torch.channels_last)quantizer = X86InductorQuantiz...
6
58
1
472
0
1,166
1,229
1,166
null
[]
None
null
0
0
0
null
0
null
The function (test_cat_recipe) defined within the public class called public.The function start at line 1166 and ends at 1229. It contains 58 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_cat_recipe_same_inputs
def test_cat_recipe_same_inputs(self):r"""Test pattern: conv -> cat([input0, input0])Since cat has 2 input node of same tensor, they should also be with same observer."""m = TestHelperModules.Conv2dCatSameInputs().eval()x = torch.randn(16, 3, 16, 16).contiguous(memory_format=torch.channels_last)quantizer = X86InductorQ...
4
40
1
351
0
1,232
1,277
1,232
null
[]
None
null
0
0
0
null
0
null
The function (test_cat_recipe_same_inputs) defined within the public class called public.The function start at line 1232 and ends at 1277. It contains 40 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_cat_recipe_single_input
def test_cat_recipe_single_input(self):r"""Test pattern: conv -> cat([input0,])Since cat has 1 input node, they should also be with same observer."""m = TestHelperModules.Conv2dCatSingleInput().eval()x = torch.randn(16, 3, 16, 16).contiguous(memory_format=torch.channels_last)quantizer = X86InductorQuantizer().set_globa...
4
37
1
314
0
1,280
1,322
1,280
null
[]
None
null
0
0
0
null
0
null
The function (test_cat_recipe_single_input) defined within the public class called public.The function start at line 1280 and ends at 1322. It contains 37 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_avg_pool2d_recipe
def test_avg_pool2d_recipe(self):r"""Test pattern: conv -> AvgPool2dSince AvgPool2d is a int8_in_int8_out_op, the inputs and outputs should with same observer."""m = TestHelperModules.Conv2dAvgPool2d().eval()x = torch.randn(16, 3, 16, 16).contiguous(memory_format=torch.channels_last)quantizer = X86InductorQuantizer().s...
6
55
1
379
0
1,325
1,384
1,325
null
[]
None
null
0
0
0
null
0
null
The function (test_avg_pool2d_recipe) defined within the public class called public.The function start at line 1325 and ends at 1384. It contains 55 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_linear
def test_linear(self):"""Test pattern of single linear with X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():for use_bias in [True, False]:m = TestHelperModules.SingleLinearModule(use_bias).eval()example_inputs = (torch.randn(2, 4),)quantizer = X86InductorQuantizer().set_global(xiq.get_def...
2
26
1
167
0
1,387
1,417
1,387
null
[]
None
null
0
0
0
null
0
null
The function (test_linear) defined within the public class called public.The function start at line 1387 and ends at 1417. It contains 26 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_linear_unary_helper
def _test_linear_unary_helper(self,post_op_module,post_op_aten,post_op_aten_inplace,post_op_algo_list=None,is_qat=False,is_dynamic=False,):"""Test pattern of linear with unary post ops (e.g. relu) with X86InductorQuantizer."""use_bias_list = [True, False]# TODO test for inplace add after refactoring of torch.export.exp...
8
61
7
279
0
1,419
1,485
1,419
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_unary_helper) defined within the public class called public.The function start at line 1419 and ends at 1485. It contains 61 lines of code and it has a cyclomatic complexity of 8. It takes 7 parameters, represented as [1419.0] and does not return any value..
pytorch_ao
public
public
0
0
test_linear_unary
def test_linear_unary(self):aten = torch.ops.atenself._test_linear_unary_helper(nn.ReLU, aten.relu.default, aten.relu_.default)self._test_linear_unary_helper(nn.LeakyReLU, aten.leaky_relu.default, aten.leaky_relu_.default)self._test_linear_unary_helper(nn.GELU, aten.gelu.default, None, ["none", "tanh"])
1
9
1
74
0
1,488
1,496
1,488
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_unary) defined within the public class called public.The function start at line 1488 and ends at 1496. 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_linear_unary_qat
def test_linear_unary_qat(self):aten = torch.ops.atenself._test_linear_unary_helper(nn.ReLU, aten.relu.default, aten.relu_.default, is_qat=True)self._test_linear_unary_helper(nn.LeakyReLU, aten.leaky_relu.default, aten.leaky_relu_.default, is_qat=True)self._test_linear_unary_helper(nn.GELU, aten.gelu.default, None, ["n...
1
11
1
86
0
1,499
1,509
1,499
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_unary_qat) defined within the public class called public.The function start at line 1499 and ends at 1509. 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_linear_unary_dynamic
def test_linear_unary_dynamic(self):aten = torch.ops.atenself._test_linear_unary_helper(nn.ReLU, aten.relu.default, aten.relu_.default, is_dynamic=True)self._test_linear_unary_helper(nn.LeakyReLU,aten.leaky_relu.default,aten.leaky_relu_.default,is_dynamic=True,)self._test_linear_unary_helper(nn.GELU, aten.gelu.default,...
1
14
1
87
0
1,512
1,525
1,512
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_unary_dynamic) defined within the public class called public.The function start at line 1512 and ends at 1525. 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_linear_unary_dynamic_qat
def test_linear_unary_dynamic_qat(self):aten = torch.ops.atenself._test_linear_unary_helper(nn.ReLU, aten.relu.default, aten.relu_.default, is_qat=True, is_dynamic=True)self._test_linear_unary_helper(nn.LeakyReLU,aten.leaky_relu.default,aten.leaky_relu_.default,is_qat=True,is_dynamic=True,)self._test_linear_unary_helpe...
1
20
1
100
0
1,528
1,547
1,528
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_unary_dynamic_qat) defined within the public class called public.The function start at line 1528 and ends at 1547. 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
_check_annotation_stat._check_annotation
def _check_annotation(node):annot = node.meta.get(QUANT_ANNOTATION_KEY, None)if annot is None:return False, Falsereturn annot._annotated, annot._is_output_of_quantized_pattern
2
5
1
34
0
1,552
1,556
1,552
null
[]
None
null
0
0
0
null
0
null
The function (_check_annotation_stat._check_annotation) defined within the public class called public.The function start at line 1552 and ends at 1556. It contains 5 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
_check_annotation_stat
def _check_annotation_stat(self, gm, expected_stat_dict):# Check expected annotation statistics to ensure the annotation is correctdef _check_annotation(node):annot = node.meta.get(QUANT_ANNOTATION_KEY, None)if annot is None:return False, Falsereturn annot._annotated, annot._is_output_of_quantized_patternfor node in gm...
5
9
3
85
0
1,549
1,564
1,549
null
[]
None
null
0
0
0
null
0
null
The function (_check_annotation_stat) defined within the public class called public.The function start at line 1549 and ends at 1564. It contains 9 lines of code and it has a cyclomatic complexity of 5. It takes 3 parameters, represented as [1549.0] and does not return any value..
pytorch_ao
public
public
0
0
_test_linear_binary_helper
def _test_linear_binary_helper(self, is_qat=False, is_dynamic=False):"""Test pattern of linear with binary post ops (such as add) with X86InductorQuantizer.Currently, only add as binary post op is supported."""linear_pos_list = [NodePosType.left, NodePosType.right, NodePosType.both]# TODO test for inplace add after ref...
10
69
3
400
0
1,566
1,648
1,566
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_binary_helper) defined within the public class called public.The function start at line 1566 and ends at 1648. It contains 69 lines of code and it has a cyclomatic complexity of 10. It takes 3 parameters, represented as [1566.0] and does not return any value..
pytorch_ao
public
public
0
0
test_linear_binary
def test_linear_binary(self):self._test_linear_binary_helper()
1
2
1
10
0
1,651
1,652
1,651
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary) defined within the public class called public.The function start at line 1651 and ends at 1652. 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_linear_binary_qat
def test_linear_binary_qat(self):self._test_linear_binary_helper(is_qat=True)
1
2
1
13
0
1,655
1,656
1,655
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_qat) 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. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_linear_binary_dynamic
def test_linear_binary_dynamic(self):self._test_linear_binary_helper(is_dynamic=True)
1
2
1
13
0
1,659
1,660
1,659
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_dynamic) defined within the public class called public.The function start at line 1659 and ends at 1660. 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_linear_binary_dynamic_qat
def test_linear_binary_dynamic_qat(self):self._test_linear_binary_helper(is_qat=True, is_dynamic=True)
1
2
1
17
0
1,663
1,664
1,663
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_dynamic_qat) defined within the public class called public.The function start at line 1663 and ends at 1664. 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_linear_binary2
def test_linear_binary2(self):"""Test Pattern:tmp = linear_1(x)tmp2 = linear_2(tmp)return tmp + tmp2Since linear_1 has 2 users, we should annotate linear_2 for binary fusion instead of linear_1"""example_inputs = (torch.randn(2, 16),)# TODO test for inplace add after refactoring of torch.export.exportinplace_add_list =...
6
58
1
328
0
1,667
1,736
1,667
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary2) defined within the public class called public.The function start at line 1667 and ends at 1736. It contains 58 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
_test_linear_binary_unary_helper
def _test_linear_binary_unary_helper(self, is_qat=False, is_dynamic=False):"""Test pattern of linear with binary + unary post ops (such as add + relu) with X86InductorQuantizer.Currently, only add as binary post op and relu as unary post op are supported."""linear_pos_list = [NodePosType.left, NodePosType.right, NodePo...
11
73
3
437
0
1,739
1,827
1,739
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_binary_unary_helper) defined within the public class called public.The function start at line 1739 and ends at 1827. It contains 73 lines of code and it has a cyclomatic complexity of 11. It takes 3 parameters, represented as [1739.0] and does not return any value..
pytorch_ao
public
public
0
0
test_linear_binary_unary
def test_linear_binary_unary(self):self._test_linear_binary_unary_helper()
1
2
1
10
0
1,830
1,831
1,830
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_unary) defined within the public class called public.The function start at line 1830 and ends at 1831. 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_linear_binary_unary_qat
def test_linear_binary_unary_qat(self):self._test_linear_binary_unary_helper(is_qat=True)
1
2
1
13
0
1,834
1,835
1,834
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_unary_qat) defined within the public class called public.The function start at line 1834 and ends at 1835. 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_linear_binary_unary_dynamic
def test_linear_binary_unary_dynamic(self):self._test_linear_binary_unary_helper(is_dynamic=True)
1
2
1
13
0
1,838
1,839
1,838
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_unary_dynamic) defined within the public class called public.The function start at line 1838 and ends at 1839. 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_linear_binary_unary_dynamic_qat
def test_linear_binary_unary_dynamic_qat(self):self._test_linear_binary_unary_helper(is_qat=True, is_dynamic=True)
1
2
1
17
0
1,842
1,843
1,842
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_unary_dynamic_qat) defined within the public class called public.The function start at line 1842 and ends at 1843. 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_linear_binary_unary_serials
def test_linear_binary_unary_serials(self):"""Test pattern of 2 following up linear add relu with X86InductorQuantizer."""is_qat_list = [False, True]is_dynamic_list = [False, True]cases = itertools.product(is_qat_list, is_dynamic_list)with override_quantized_engine("x86"), torch.no_grad():for is_qat, is_dynamic in case...
5
58
1
345
0
1,846
1,913
1,846
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_binary_unary_serials) defined within the public class called public.The function start at line 1846 and ends at 1913. It contains 58 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_linear_dynamic_fp16
def test_linear_dynamic_fp16(self):"""Test pattern of linear_dynamic_fp16."""with override_quantized_engine("x86"), torch.no_grad():for use_bias in [True, False]:m = TestHelperModules.SingleLinearModule(use_bias).eval()example_inputs = (torch.randn(2, 4),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x8...
2
29
1
185
0
1,916
1,948
1,916
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_dynamic_fp16) defined within the public class called public.The function start at line 1916 and ends at 1948. It contains 29 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_qat_conv2d
def test_qat_conv2d(self):"""Test QAT pattern of conv2d_bn with X86InductorQuantizer."""with override_quantized_engine("x86"):m = TestHelperModules.SingleConv2dModule(with_bn=True)example_inputs = (torch.randn(2, 3, 16, 16),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization_config(...
1
29
1
193
0
1,952
1,986
1,952
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_conv2d) defined within the public class called public.The function start at line 1952 and ends at 1986. It contains 29 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_qat_conv2d_unary
def test_qat_conv2d_unary(self):"""Test QAT pattern of conv2d_bn with unary post ops (such as relu, sigmoid) with X86InductorQuantizer.Currently, only relu as unary post op is supported."""unary_map = {"relu": [torch.nn.ReLU(inplace=False), torch.ops.aten.relu.default],"relu_inplace": [torch.nn.ReLU(inplace=True), torc...
2
63
1
502
0
1,990
2,060
1,990
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_conv2d_unary) defined within the public class called public.The function start at line 1990 and ends at 2060. It contains 63 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_qat_conv2d_binary
def test_qat_conv2d_binary(self):"""Test qat pattern of conv2d_bn with binary post ops (such as add) with X86InductorQuantizer.Currently, only add as binary post op is supported."""example_inputs = (torch.randn(2, 3, 6, 6),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization_config(i...
3
37
1
230
0
2,064
2,109
2,064
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_conv2d_binary) defined within the public class called public.The function start at line 2064 and ends at 2109. It contains 37 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_qat_conv2d_binary2
def test_qat_conv2d_binary2(self):"""Test qat Pattern:tmp = bn1(conv2d_1(x))tmp2 = bn2(conv2d_2(tmp))return tmp + tmp2Since conv2d_1 has 2 users, we should annotate conv2d_2 for binary fusion instead of conv2d_1"""example_inputs = (torch.randn(2, 3, 6, 6),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x...
3
35
1
225
0
2,113
2,156
2,113
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_conv2d_binary2) defined within the public class called public.The function start at line 2113 and ends at 2156. It contains 35 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_qat_conv2d_binary_unary
def test_qat_conv2d_binary_unary(self):"""Test QAT pattern of conv2d_bn with binary + unary post ops (such as add + relu) with X86InductorQuantizer.Currently, only add as binary post op and relu as unary post op are supported."""example_inputs = (torch.randn(2, 3, 6, 6),)quantizer = X86InductorQuantizer().set_global(xi...
1
30
1
203
0
2,160
2,198
2,160
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_conv2d_binary_unary) defined within the public class called public.The function start at line 2160 and ends at 2198. It contains 30 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_dynamic_quant_linear
def test_dynamic_quant_linear(self):"""Test pattern of dynamic quantization of linear with X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.SelfAttnLikeModule(input_dim=64).eval()example_inputs = (torch.randn(1, 4, 64),)quantizer = X86InductorQuantizer().set_global(xi...
1
27
1
187
0
2,201
2,231
2,201
null
[]
None
null
0
0
0
null
0
null
The function (test_dynamic_quant_linear) defined within the public class called public.The function start at line 2201 and ends at 2231. 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_qat_dynamic_quant_linear
def test_qat_dynamic_quant_linear(self):"""Test pattern of qat dynamic quantization of linear with X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.SelfAttnLikeModule(input_dim=64).eval()example_inputs = (torch.randn(1, 4, 64),)quantizer = X86InductorQuantizer().set_g...
1
30
1
195
0
2,234
2,267
2,234
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_dynamic_quant_linear) defined within the public class called public.The function start at line 2234 and ends at 2267. It contains 30 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_set_module_name_qconfig.__init__
def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.relu1 = torch.nn.ReLU(inplace=False)self.linear2 = torch.nn.Linear(10, 5)
1
5
1
56
0
2,277
2,281
2,277
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig.__init__) defined within the public class called public.The function start at line 2277 and ends at 2281. 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_set_module_name_qconfig.forward
def forward(self, x):x = self.linear1(x)x = self.relu1(x)x = self.linear2(x)return x
1
5
2
33
0
2,283
2,287
2,283
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig.forward) defined within the public class called public.The function start at line 2283 and ends at 2287. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2283.0] and does not return any value..
pytorch_ao
public
public
0
0
test_set_module_name_qconfig.__init__
def __init__(self) -> None:super().__init__()self.linear = torch.nn.Linear(5, 5)self.sub = Sub()
1
4
1
35
0
2,290
2,293
2,290
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig.__init__) defined within the public class called public.The function start at line 2290 and ends at 2293. 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_set_module_name_qconfig.forward
def forward(self, x):x = self.linear(x)x = self.sub(x)return x
1
4
2
25
0
2,295
2,298
2,295
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig.forward) defined within the public class called public.The function start at line 2295 and ends at 2298. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2295.0] and does not return any value..
pytorch_ao
public
public
0
0
test_set_module_name_qconfig
def test_set_module_name_qconfig(self):"""Test case for quantizing a specific submodule by configuring `set_module_name_qconfig`.Expect that all linear layers within the submodule `sub` are quantized."""class Sub(torch.nn.Module):def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.rel...
1
35
1
214
0
2,270
2,332
2,270
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig) defined within the public class called public.The function start at line 2270 and ends at 2332. It contains 35 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_set_module_name_qconfig_with_underscores.__init__
def __init__(self) -> None:super().__init__()# This module name has underscores, which can be part of a mangled name.self.foo_bar = torch.nn.Linear(2, 2)self.baz = torch.nn.Linear(2, 2)
1
4
1
42
0
2,339
2,343
2,339
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig_with_underscores.__init__) defined within the public class called public.The function start at line 2339 and ends at 2343. 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_set_module_name_qconfig_with_underscores.forward
def forward(self, x):return self.baz(self.foo_bar(x))
1
2
2
19
0
2,345
2,346
2,345
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig_with_underscores.forward) defined within the public class called public.The function start at line 2345 and ends at 2346. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2345.0] and does not return any value..
pytorch_ao
public
public
0
0
test_set_module_name_qconfig_with_underscores
def test_set_module_name_qconfig_with_underscores(self) -> None:"""Test that if a module name has an underscore, we can still quantize it."""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()# This module name has underscores, which can be part of a mangled name.self.foo_bar = torch.nn.Linear(2, 2)s...
5
33
1
190
0
2,335
2,382
2,335
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig_with_underscores) defined within the public class called public.The function start at line 2335 and ends at 2382. It contains 33 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_set_module_name_and_module_type_case1.__init__
def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.linear2 = torch.nn.Linear(10, 5)self.sub = torch.nn.Linear(5, 5)
1
5
1
56
0
2,392
2,396
2,392
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_case1.__init__) defined within the public class called public.The function start at line 2392 and ends at 2396. 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_set_module_name_and_module_type_case1.forward
def forward(self, x):x = self.linear1(x)x = self.linear2(x)x = self.sub(x)return x
1
5
2
33
0
2,398
2,402
2,398
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_case1.forward) defined within the public class called public.The function start at line 2398 and ends at 2402. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2398.0] and does not return any value..
pytorch_ao
public
public
0
0
test_set_module_name_and_module_type_case1
def test_set_module_name_and_module_type_case1(self):"""Test that set `module_name_qconfig` and `module_type_qconfig` at the same time.Expect that all linear layers are not quantized except the last one."""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.li...
1
30
1
191
0
2,385
2,436
2,385
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_case1) defined within the public class called public.The function start at line 2385 and ends at 2436. It contains 30 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_set_module_name_and_module_type_case2.__init__
def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.linear2 = torch.nn.Linear(10, 5)self.sub = torch.nn.Linear(5, 5)
1
5
1
56
0
2,446
2,450
2,446
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_case2.__init__) defined within the public class called public.The function start at line 2446 and ends at 2450. 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_set_module_name_and_module_type_case2.forward
def forward(self, x):x = self.linear1(x)x = self.linear2(x)x = self.sub(x)return x
1
5
2
33
0
2,452
2,456
2,452
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_case2.forward) defined within the public class called public.The function start at line 2452 and ends at 2456. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2452.0] and does not return any value..
pytorch_ao
public
public
0
0
test_set_module_name_and_module_type_case2
def test_set_module_name_and_module_type_case2(self):"""Test that set `module_name_qconfig` and `module_type_qconfig` at the same time.Expect that all linear layers are quantized except the last one."""class M(torch.nn.Module):def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.linear...
1
32
1
211
0
2,439
2,492
2,439
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_case2) defined within the public class called public.The function start at line 2439 and ends at 2492. It contains 32 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_set_module_name_qconfig_for_dynamic_quant
def test_set_module_name_qconfig_for_dynamic_quant(self):"""Test that quantize a specific submodule for dynamic quantization."""with override_quantized_engine("x86"), torch.no_grad():for is_qat in [False, True]:m = TestHelperModules.SelfAttnLikeModule(input_dim=64).eval()example_inputs = (torch.randn(1, 4, 64),)# only ...
2
35
1
226
0
2,495
2,538
2,495
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_qconfig_for_dynamic_quant) defined within the public class called public.The function start at line 2495 and ends at 2538. It contains 35 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_set_module_name_with_mixed_configs
def test_set_module_name_with_mixed_configs(self):"""Test case for setting module names with mixed static/dynamic or QAT/non-QAT configurations.The config for 'v_proj' will always be ignored and raise a warning."""with override_quantized_engine("x86"), torch.no_grad():with self.assertWarns(UserWarning) as context:for q...
9
66
1
306
0
2,541
2,615
2,541
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_with_mixed_configs) defined within the public class called public.The function start at line 2541 and ends at 2615. It contains 66 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_set_module_name_and_module_type_with_mixed_configs.__init__
def __init__(self) -> None:super().__init__()self.linear1 = torch.nn.Linear(5, 10)self.linear2 = torch.nn.Linear(10, 5)self.sub = torch.nn.Linear(5, 5)
1
5
1
56
0
2,625
2,629
2,625
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_with_mixed_configs.__init__) defined within the public class called public.The function start at line 2625 and ends at 2629. 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_set_module_name_and_module_type_with_mixed_configs.forward
def forward(self, x):x = self.linear1(x)x = self.linear2(x)x = self.sub(x)return x
1
5
2
33
0
2,631
2,635
2,631
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_with_mixed_configs.forward) defined within the public class called public.The function start at line 2631 and ends at 2635. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2631.0] and does not return any value...
pytorch_ao
public
public
0
0
test_set_module_name_and_module_type_with_mixed_configs
def test_set_module_name_and_module_type_with_mixed_configs(self):"""Test that set `module_name_qconfig` and `module_type_qconfig` at the same time with mixed the configs.Expect that only the last linear(`sub`) is quantized using static quantization."""class M(torch.nn.Module):def __init__(self) -> None:super().__init_...
1
33
1
202
0
2,618
2,671
2,618
null
[]
None
null
0
0
0
null
0
null
The function (test_set_module_name_and_module_type_with_mixed_configs) defined within the public class called public.The function start at line 2618 and ends at 2671. It contains 33 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_filter_conv2d_recipe
def test_filter_conv2d_recipe(self):"""Test removing conv2d from default recipe of X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.Conv2dUnaryModule(torch.nn.ReLU(inplace=False)).eval()example_inputs = (torch.randn(2, 3, 16, 16),)quantizer = X86InductorQuantizer().se...
1
25
1
173
0
2,674
2,703
2,674
null
[]
None
null
0
0
0
null
0
null
The function (test_filter_conv2d_recipe) defined within the public class called public.The function start at line 2674 and ends at 2703. It contains 25 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_filter_linear_recipe
def test_filter_linear_recipe(self):"""Test removing linear from default recipe of X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.LinearUnaryModule(use_bias=True,postop=nn.ReLU,).eval()example_inputs = (torch.randn(2, 4),)quantizer = X86InductorQuantizer().set_globa...
1
28
1
171
0
2,706
2,738
2,706
null
[]
None
null
0
0
0
null
0
null
The function (test_filter_linear_recipe) defined within the public class called public.The function start at line 2706 and ends at 2738. 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_filter_maxpool2d_recipe
def test_filter_maxpool2d_recipe(self):"""Test removing maxpool2d from default recipe of X86InductorQuantizer."""with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.Conv2dUnaryModule(torch.nn.ReLU(inplace=False)).eval()example_inputs = (torch.randn(2, 3, 16, 16),)quantizer = X86InductorQuantize...
1
28
1
205
0
2,741
2,773
2,741
null
[]
None
null
0
0
0
null
0
null
The function (test_filter_maxpool2d_recipe) defined within the public class called public.The function start at line 2741 and ends at 2773. 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_attention_block
def test_attention_block(self):"""Test pattern of Attention like Block with X86InductorQuantizer."""for annotate_matmul in [False, True]:with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.SelfAttnLikeModule(input_dim=64 * 16,transpose_for_score=True,num_attention_heads=16,attention_head_size=6...
6
59
1
379
0
2,776
2,842
2,776
null
[]
None
null
0
0
0
null
0
null
The function (test_attention_block) defined within the public class called public.The function start at line 2776 and ends at 2842. It contains 59 lines of code and it has a cyclomatic complexity of 6. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_lowering_to_x86
def test_lowering_to_x86(self):with override_quantized_engine("x86"), torch.no_grad():m = TestHelperModules.MiniResNet().eval()example_inputs = (torch.randn(2, 3, 16, 16),)quantizer = X86InductorQuantizer().set_global(xiq.get_default_x86_inductor_quantization_config())node_occurrence = {torch.ops.quantized_decomposed.q...
1
27
1
174
0
2,848
2,874
2,848
null
[]
None
null
0
0
0
null
0
null
The function (test_lowering_to_x86) defined within the public class called public.The function start at line 2848 and ends at 2874. 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_annotate_mul_tensor.__init__
def __init__(self):super().__init__()
1
2
1
12
0
2,879
2,880
2,879
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.__init__) defined within the public class called public.The function start at line 2879 and ends at 2880. 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_annotate_mul_tensor.forward
def forward(self, x, y):return x * y
1
2
3
13
0
2,882
2,883
2,882
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.forward) defined within the public class called public.The function start at line 2882 and ends at 2883. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2882.0] and does not return any value..
pytorch_ao
public
public
0
0
test_annotate_mul_tensor.__init__
def __init__(self):super().__init__()
1
2
1
12
0
2,886
2,887
2,879
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.__init__) defined within the public class called public.The function start at line 2886 and ends at 2887. 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_annotate_mul_tensor.forward
def forward(self, x, y):return x * y.sum(-1)
1
2
3
19
0
2,889
2,890
2,889
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.forward) defined within the public class called public.The function start at line 2889 and ends at 2890. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2889.0] and does not return any value..
pytorch_ao
public
public
0
0
test_annotate_mul_tensor.__init__
def __init__(self):super().__init__()
1
2
1
12
0
2,893
2,894
2,879
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.__init__) 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. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
test_annotate_mul_tensor.forward
def forward(self, x, y):return x * y.sum()
1
2
3
17
0
2,896
2,897
2,896
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.forward) defined within the public class called public.The function start at line 2896 and ends at 2897. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2896.0] and does not return any value..
pytorch_ao
public
public
0
0
test_annotate_mul_tensor.__init__
def __init__(self):super().__init__()
1
2
1
12
0
2,900
2,901
2,879
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.__init__) defined within the public class called public.The function start at line 2900 and ends at 2901. 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_annotate_mul_tensor.forward
def forward(self, x, y):return x * y.sum().item()
1
2
3
21
0
2,903
2,904
2,903
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor.forward) defined within the public class called public.The function start at line 2903 and ends at 2904. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2903.0] and does not return any value..
pytorch_ao
public
public
0
0
test_annotate_mul_tensor
def test_annotate_mul_tensor(self):class M1(torch.nn.Module):def __init__(self):super().__init__()def forward(self, x, y):return x * yclass M2(torch.nn.Module):def __init__(self):super().__init__()def forward(self, x, y):return x * y.sum(-1)class M3(torch.nn.Module):def __init__(self):super().__init__()def forward(self...
5
48
1
277
0
2,877
2,941
2,877
null
[]
None
null
0
0
0
null
0
null
The function (test_annotate_mul_tensor) defined within the public class called public.The function start at line 2877 and ends at 2941. It contains 48 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
__init__
def __init__(self, in_features, out_features):super().__init__()self.linear1 = torch.nn.Linear(in_features, out_features, bias=False)self.linear2 = torch.nn.Linear(out_features, in_features, bias=False)
1
4
3
52
0
43
46
43
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 43 and ends at 46. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [43.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):x = self.linear1(x)x = self.linear2(x)return x
1
4
2
25
0
48
51
48
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 48 and ends at 51. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [48.0] and does not return any value..
pytorch_ao
public
public
0
0
setUp
def setUp(self):self.GPU_DEVICES = ["cuda"] if torch.cuda.is_available() else []
2
2
1
23
0
59
60
59
null
[]
None
null
0
0
0
null
0
null
The function (setUp) defined within the public class called public.The function start at line 59 and ends at 60. It contains 2 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_fp8_linear_variants
def test_fp8_linear_variants(self,dtype: torch.dtype,mode: str,compile: bool,granularity,kernel_preference: KernelPreference,sizes: Tuple,):if (isinstance(granularity, PerTensor)and kernel_preference == KernelPreference.FBGEMM):return unittest.skip("per tensor with fbgemm kernel preferece does not work yet")error_messa...
14
57
7
290
0
82
151
82
null
[]
None
null
0
0
0
null
0
null
The function (test_fp8_linear_variants) defined within the public class called public.The function start at line 82 and ends at 151. It contains 57 lines of code and it has a cyclomatic complexity of 14. It takes 7 parameters, represented as [82.0] and does not return any value..
pytorch_ao
public
public
0
0
test_slice
def test_slice(self, granularity):config = Float8DynamicActivationFloat8WeightConfig(granularity=granularity)dtype = torch.bfloat16device = "cuda"dummy = torch.nn.Linear(256, 256, bias=False, dtype=dtype, device=device)dummy1 = torch.nn.Linear(256, 64, bias=False, dtype=dtype, device=device)dummy1.weight = torch.nn.Par...
2
54
2
452
0
159
217
159
null
[]
None
null
0
0
0
null
0
null
The function (test_slice) defined within the public class called public.The function start at line 159 and ends at 217. It contains 54 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [159.0] and does not return any value..
pytorch_ao
public
public
0
0
test_kernel_preference_numerical_equivalence
def test_kernel_preference_numerical_equivalence(self, granularity, sizes):"""Test different kernel preferences have the same numerics for float8 dynamic activationand float8 weight config"""M, N, K = sizesdtype = torch.bfloat16input_tensor = torch.randn(*M, K, dtype=dtype, device="cuda")# Create a linear layer with bf...
6
37
3
233
0
228
276
228
null
[]
None
null
0
0
0
null
0
null
The function (test_kernel_preference_numerical_equivalence) defined within the public class called public.The function start at line 228 and ends at 276. It contains 37 lines of code and it has a cyclomatic complexity of 6. It takes 3 parameters, represented as [228.0] and does not return any value..
pytorch_ao
public
public
0
0
test_slice_preserves_aliasing
def test_slice_preserves_aliasing(self, granularity):config = Float8DynamicActivationFloat8WeightConfig(granularity=granularity)l = torch.nn.Linear(1024, 1024).to("cuda").to(torch.bfloat16)l.weight = torch.nn.Parameter(torch.zeros(1024, 1024, dtype=torch.bfloat16, device="cuda"))quantize_(l, config)param = l.weightpara...
1
12
2
132
0
279
291
279
null
[]
None
null
0
0
0
null
0
null
The function (test_slice_preserves_aliasing) defined within the public class called public.The function start at line 279 and ends at 291. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [279.0] and does not return any value..
pytorch_ao
public
public
0
0
test_slice_and_copy_similar_to_vllm
def test_slice_and_copy_similar_to_vllm(self, granularity):config = Float8DynamicActivationFloat8WeightConfig(granularity=granularity)self._test_slice_and_copy_similar_to_vllm(config)
1
3
2
21
0
294
296
294
null
[]
None
null
0
0
0
null
0
null
The function (test_slice_and_copy_similar_to_vllm) defined within the public class called public.The function start at line 294 and ends at 296. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [294.0] and does not return any value..