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
_qlinear_unary_test_helper.__init__
def __init__(self, use_bias):super().__init__()self.linear = torch.nn.Linear(4, 4, use_bias)self.unary_fn = copy.deepcopy(unary_op)self.linear2 = torch.nn.Linear(4, 4, use_bias)self.unary_fn2 = copy.deepcopy(unary_op)
1
6
2
66
0
1,516
1,521
1,516
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_unary_test_helper.__init__) defined within the public class called public.The function start at line 1516 and ends at 1521. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1516.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_unary_test_helper.forward
def forward(self, x):tmp = self.unary_fn(self.linear(x))return self.unary_fn2(self.linear2(tmp))
1
3
2
32
0
1,523
1,525
1,523
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_unary_test_helper.forward) defined within the public class called public.The function start at line 1523 and ends at 1525. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1523.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_unary_test_helper.matcher_check_fn
def matcher_check_fn():# 1. dequant-linear pattern matched in quantization weight prepackself.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 2)# 2. QLinear Unary fusion in post-grad fusion passself.assertEqual(counters["inductor"]["qlinear_unary_matcher_count"],0 if TEST_ACL else 2,)self.asse...
3
12
0
56
0
1,531
1,544
1,531
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_unary_test_helper.matcher_check_fn) defined within the public class called public.The function start at line 1531 and ends at 1544. It contains 12 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
_qlinear_unary_test_helper
def _qlinear_unary_test_helper(self, inputs, unary_op=torch.nn.ReLU(), device="cpu", int8_mixed_bf16=False):class M(torch.nn.Module):def __init__(self, use_bias):super().__init__()self.linear = torch.nn.Linear(4, 4, use_bias)self.unary_fn = copy.deepcopy(unary_op)self.linear2 = torch.nn.Linear(4, 4, use_bias)self.unary...
3
17
3
97
0
1,512
1,552
1,512
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_unary_test_helper) defined within the public class called public.The function start at line 1512 and ends at 1552. It contains 17 lines of code and it has a cyclomatic complexity of 3. It takes 3 parameters, represented as [1512.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qlinear_relu_cpu
def test_qlinear_relu_cpu(self):r"""This testcase will quantize a Linear->ReLU pattern."""self._qlinear_unary_test_helper((torch.randn((2, 4)),))
1
2
1
25
0
1,556
1,560
1,556
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_relu_cpu) defined within the public class called public.The function start at line 1556 and ends at 1560. 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_qlinear_relu_int8_mixed_bf16
def test_qlinear_relu_int8_mixed_bf16(self):r"""This testcase will quantize a Linear->ReLU pattern with int8_mixed_bf16 quantization."""self._qlinear_unary_test_helper((torch.randn((2, 4)),), int8_mixed_bf16=True)
1
2
1
29
0
1,565
1,569
1,565
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_relu_int8_mixed_bf16) defined within the public class called public.The function start at line 1565 and ends at 1569. 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_qlinear_relu_input_dim_exceeds_2
def test_qlinear_relu_input_dim_exceeds_2(self):r"""This testcase will quantize a Linear->ReLU pattern."""self._qlinear_unary_test_helper((torch.randn((2, 3, 4)),))
1
2
1
27
0
1,573
1,577
1,573
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_relu_input_dim_exceeds_2) defined within the public class called public.The function start at line 1573 and ends at 1577. 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_qlinear_relu_int8_mixed_bf16_input_dim_exceeds_2
def test_qlinear_relu_int8_mixed_bf16_input_dim_exceeds_2(self):r"""This testcase will quantize a Linear->ReLU pattern with int8_mixed_bf16 quantization."""self._qlinear_unary_test_helper((torch.randn((2, 3, 4)),), int8_mixed_bf16=True)
1
2
1
31
0
1,582
1,586
1,582
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_relu_int8_mixed_bf16_input_dim_exceeds_2) defined within the public class called public.The function start at line 1582 and ends at 1586. 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_qlinear_gelu_cpu
def test_qlinear_gelu_cpu(self):r"""This testcase will quantize a Linear->GELU pattern."""for gelu in [torch.nn.GELU("none"), torch.nn.GELU("tanh")]:self._qlinear_unary_test_helper((torch.randn((2, 4)),), gelu)
2
3
1
50
0
1,590
1,595
1,590
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_gelu_cpu) defined within the public class called public.The function start at line 1590 and ends at 1595. It contains 3 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_qlinear_gelu_int8_mixed_bf16
def test_qlinear_gelu_int8_mixed_bf16(self):r"""This testcase will quantize a Linear->GELU pattern with int8_mixed_bf16 quantization."""for gelu in [torch.nn.GELU("none"), torch.nn.GELU("tanh")]:self._qlinear_unary_test_helper((torch.randn((2, 4)),), gelu, int8_mixed_bf16=True)
2
5
1
54
0
1,600
1,607
1,600
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_gelu_int8_mixed_bf16) defined within the public class called public.The function start at line 1600 and ends at 1607. 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
_qlinear_add_test_helper.fake_quant
def fake_quant(x):# to produce a float32 result as extra inputqlib = torch.ops.quantized_decomposedif device == "cpu":qmin, qmax, dtype = 0, 255, torch.uint8else:qmin, qmax, dtype = -128, 127, torch.int8x = qlib.quantize_per_tensor.default(x, 0.0166785, 42, qmin, qmax, dtype)x = qlib.dequantize_per_tensor.default(x, 0....
2
9
1
92
0
1,636
1,645
1,636
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_add_test_helper.fake_quant) defined within the public class called public.The function start at line 1636 and ends at 1645. It contains 9 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
_qlinear_add_test_helper.__init__
def __init__(self,add_fn,use_relu,fake_quant_before_extra_input,):super().__init__()self.linear1 = torch.nn.Linear(4, 4)self.linear2 = torch.nn.Linear(4, 4)self.add_fn = add_fnself.relu = torch.nn.ReLU()self.linear3 = torch.nn.Linear(4, 4)self.linear4 = torch.nn.Linear(4, 4)self.add_fn2 = add_fnself.relu2 = torch.nn.Re...
1
17
4
117
0
1,648
1,664
1,648
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_add_test_helper.__init__) defined within the public class called public.The function start at line 1648 and ends at 1664. It contains 17 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [1648.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_add_test_helper.forward
def forward(self, x):x1 = self.linear1(x)x2 = self.linear2(x)if self.fake_quant_before_extra_input:x2 = fake_quant(x2)tmp = self.add_fn(x1, x2)if self.use_relu:tmp = self.relu(tmp)tmp1 = self.linear3(tmp)tmp2 = self.linear4(tmp)if self.fake_quant_before_extra_input:tmp2 = fake_quant(tmp2)res = self.add_fn2(tmp1, tmp2)i...
5
16
2
109
0
1,666
1,681
1,666
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_add_test_helper.forward) defined within the public class called public.The function start at line 1666 and ends at 1681. It contains 16 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [1666.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_add_test_helper.matcher_check_fn
def matcher_check_fn():# 1. Dequant-linear pattern matched in quantization weight prepack * 4self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 4)# pattern = [dequant_per_tensor, (convert_dtype), dequant_per_channel, (convert_dtype), permute, addmm]nodes_per_match = 6 if int8_mixed_bf16 else...
8
27
0
141
0
1,698
1,733
1,698
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_add_test_helper.matcher_check_fn) defined within the public class called public.The function start at line 1698 and ends at 1733. It contains 27 lines of code and it has a cyclomatic complexity of 8. The function does not take any parameters and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_add_test_helper
def _qlinear_add_test_helper(self,device="cpu",use_relu=False,int8_mixed_bf16=False,is_qat=True,is_dynamic=True,):r"""This testcase will quantize two consecutive Linear->Add(->relu) patterns as: X / \linear(X) linear(X) \ /Add | Optional(relu) / \linear(X) linear(X) \ /Add | Optional(relu) | Y"""def fake_quant(x):# to ...
6
62
6
312
0
1,609
1,773
1,609
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_add_test_helper) defined within the public class called public.The function start at line 1609 and ends at 1773. It contains 62 lines of code and it has a cyclomatic complexity of 6. It takes 6 parameters, represented as [1609.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qlinear_add_cpu
def test_qlinear_add_cpu(self, use_relu, is_qat, is_dynamic):self._qlinear_add_test_helper(use_relu=use_relu, is_qat=is_qat, is_dynamic=is_dynamic)
1
4
4
27
0
1,780
1,783
1,780
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_add_cpu) defined within the public class called public.The function start at line 1780 and ends at 1783. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [1780.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qlinear_add_int8_mixed_bf16
def test_qlinear_add_int8_mixed_bf16(self, use_relu, is_qat, is_dynamic):self._qlinear_add_test_helper(int8_mixed_bf16=True,use_relu=use_relu,is_qat=is_qat,is_dynamic=is_dynamic,)
1
7
4
32
0
1,791
1,797
1,791
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_add_int8_mixed_bf16) defined within the public class called public.The function start at line 1791 and ends at 1797. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [1791.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_dequant_promotion_test_helper.__init__
def __init__(self,**kwargs,):super().__init__()self.linear1 = torch.nn.Linear(4, 4)self.linear2 = torch.nn.Linear(4, 4)self.linear3 = torch.nn.Linear(4, 4)
1
8
2
58
0
1,808
1,815
1,808
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_dequant_promotion_test_helper.__init__) defined within the public class called public.The function start at line 1808 and ends at 1815. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1808.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_dequant_promotion_test_helper.forward
def forward(self, x):temp = self.linear1(x)temp = self.linear2(temp) + self.linear3(temp)return temp
1
4
2
32
0
1,817
1,820
1,817
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_dequant_promotion_test_helper.forward) defined within the public class called public.The function start at line 1817 and ends at 1820. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1817.0] and does not return any value..
pytorch_ao
public
public
0
0
_qlinear_dequant_promotion_test_helper.default_matcher_check_fn
def default_matcher_check_fn():# 1. Dequant pattern matcher for dequant promotion * 1self.assertEqual(counters["inductor"]["dequant_promotion_matcher_count"], 1)# 2. dequant-linear pattern matched in quantization weight prepack * 3self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 3)# 3. QLi...
2
9
0
51
0
1,824
1,835
1,824
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_dequant_promotion_test_helper.default_matcher_check_fn) defined within the public class called public.The function start at line 1824 and ends at 1835. It contains 9 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
_qlinear_dequant_promotion_test_helper
def _qlinear_dequant_promotion_test_helper(self,inputs,device="cpu",int8_mixed_bf16=False,is_dynamic=False,matcher_check_fn=None,):class M(torch.nn.Module):def __init__(self,**kwargs,):super().__init__()self.linear1 = torch.nn.Linear(4, 4)self.linear2 = torch.nn.Linear(4, 4)self.linear3 = torch.nn.Linear(4, 4)def forwa...
3
25
6
98
0
1,799
1,848
1,799
null
[]
None
null
0
0
0
null
0
null
The function (_qlinear_dequant_promotion_test_helper) defined within the public class called public.The function start at line 1799 and ends at 1848. It contains 25 lines of code and it has a cyclomatic complexity of 3. It takes 6 parameters, represented as [1799.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qlinear_dequant_promotion_cpu
def test_qlinear_dequant_promotion_cpu(self):r"""This testcase test if dequant node before linear is promoted correctly:X| Linear1(X)/ \Linear2(X) Linear3(X)\ / Add|Y"""self._qlinear_dequant_promotion_test_helper((torch.randn((2, 4)),))
1
2
1
25
0
1,852
1,865
1,852
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_dequant_promotion_cpu) defined within the public class called public.The function start at line 1852 and ends at 1865. 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_qlinear_dequant_promotion_int8_mixed_bf16
def test_qlinear_dequant_promotion_int8_mixed_bf16(self):r"""Test with int8_mixed_bf16 quantization.This testcase test if dequant node before linear is promoted correctly:X| Linear1(X)/ \Linear2(X) Linear3(X)\ / Add|Y"""self._qlinear_dequant_promotion_test_helper((torch.randn((2, 4)),), int8_mixed_bf16=True)
1
4
1
29
0
1,870
1,886
1,870
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_dequant_promotion_int8_mixed_bf16) defined within the public class called public.The function start at line 1870 and ends at 1886. 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_qlinear_dequant_promotion_cpu_input_dim_exceeds_2
def test_qlinear_dequant_promotion_cpu_input_dim_exceeds_2(self):r"""This testcase test if dequant node before linear is promoted correctly:X| Linear1(X)/ \Linear2(X) Linear3(X)\ / Add|Y"""self._qlinear_dequant_promotion_test_helper((torch.randn((2, 3, 4)),))
1
2
1
27
0
1,890
1,903
1,890
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_dequant_promotion_cpu_input_dim_exceeds_2) defined within the public class called public.The function start at line 1890 and ends at 1903. 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_qlinear_dequant_promotion_int8_mixed_bf16_input_dim_exceeds_2
def test_qlinear_dequant_promotion_int8_mixed_bf16_input_dim_exceeds_2(self):r"""Test with int8_mixed_bf16 quantization.This testcase test if dequant node before linear is promoted correctly:X| Linear1(X)/ \Linear2(X) Linear3(X)\ / Add|Y"""self._qlinear_dequant_promotion_test_helper((torch.randn((2, 3, 4)),), int8_mixe...
1
4
1
31
0
1,908
1,924
1,908
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_dequant_promotion_int8_mixed_bf16_input_dim_exceeds_2) defined within the public class called public.The function start at line 1908 and ends at 1924. 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_qlinear_dequant_promotion_dynamic_cpu.matcher_check_fn
def matcher_check_fn():# 1. Dequant pattern matcher for dequant promotion * 1self.assertEqual(counters["inductor"]["dequant_promotion_matcher_count"], 1)# 2. dequant-linear pattern matched in quantization weight prepack * 3self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 3)
1
5
0
32
0
1,942
1,948
1,942
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_dequant_promotion_dynamic_cpu.matcher_check_fn) defined within the public class called public.The function start at line 1942 and ends at 1948. 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_qlinear_dequant_promotion_dynamic_cpu
def test_qlinear_dequant_promotion_dynamic_cpu(self):r"""This testcase test if dequant node before linear is promoted correctly:X| Linear1(X)/ \Linear2(X) Linear3(X)\ / Add|Y"""def matcher_check_fn():# 1. Dequant pattern matcher for dequant promotion * 1self.assertEqual(counters["inductor"]["dequant_promotion_matcher_c...
1
7
1
36
0
1,928
1,954
1,928
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_dequant_promotion_dynamic_cpu) defined within the public class called public.The function start at line 1928 and ends at 1954. It contains 7 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_qlinear_mul_cpu.__init__
def __init__(self, use_bias):super().__init__()self.linear = torch.nn.Linear(4, 5, use_bias)
1
3
2
30
0
1,964
1,966
1,964
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_mul_cpu.__init__) defined within the public class called public.The function start at line 1964 and ends at 1966. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1964.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qlinear_mul_cpu.forward
def forward(self, x1, x2):return torch.mul(self.linear(x1), x2)
1
2
3
23
0
1,968
1,969
1,968
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_mul_cpu.forward) defined within the public class called public.The function start at line 1968 and ends at 1969. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [1968.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qlinear_mul_cpu.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 1)
1
4
0
18
0
1,977
1,980
1,977
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_mul_cpu.matcher_check_fn) defined within the public class called public.The function start at line 1977 and ends at 1980. 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_qlinear_mul_cpu
def test_qlinear_mul_cpu(self):r"""This testcase will quantize a Linear->Mul pattern."""class M(torch.nn.Module):def __init__(self, use_bias):super().__init__()self.linear = torch.nn.Linear(4, 5, use_bias)def forward(self, x1, x2):return torch.mul(self.linear(x1), x2)bias_list = [True, False]for bias in bias_list:mod =...
2
16
1
88
0
1,958
1,987
1,958
null
[]
None
null
0
0
0
null
0
null
The function (test_qlinear_mul_cpu) defined within the public class called public.The function start at line 1958 and ends at 1987. It contains 16 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_qmaxpool2d.__init__
def __init__(self,kwargs,):super().__init__()self.conv = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)self.relu = torch.nn.ReLU()self.maxpool = torch.nn.MaxPool2d(3, **kwargs)
1
10
2
73
0
1,996
2,005
1,996
null
[]
None
null
0
0
0
null
0
null
The function (test_qmaxpool2d.__init__) defined within the public class called public.The function start at line 1996 and ends at 2005. It contains 10 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [1996.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qmaxpool2d.forward
def forward(self, x):return self.maxpool(self.relu(self.conv(x)))
1
2
2
24
0
2,007
2,008
2,007
null
[]
None
null
0
0
0
null
0
null
The function (test_qmaxpool2d.forward) defined within the public class called public.The function start at line 2007 and ends at 2008. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2007.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qmaxpool2d.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qmaxpool2d_matcher_count"],0 if TEST_ACL else 1,)self.assertEqual(counters["inductor"]["qconv_weight_prepack_matcher_count"], 1)self.assertEqual(counters["inductor"]["qconv_unary_matcher_count"],0 if TEST_ACL else 1,)self.assertEqual(counters["inductor"]["qc...
4
16
0
75
0
2,022
2,037
2,022
null
[]
None
null
0
0
0
null
0
null
The function (test_qmaxpool2d.matcher_check_fn) defined within the public class called public.The function start at line 2022 and ends at 2037. It contains 16 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_qmaxpool2d
def test_qmaxpool2d(self):r"""This testcase will quantize Conv2d->ReLU->MaxPool2d pattern."""class M(torch.nn.Module):def __init__(self,kwargs,):super().__init__()self.conv = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)self.relu = torch.nn.ReLU()self.maxpool = torch.nn.MaxPool2d(3, **kwargs)def...
2
22
1
139
0
1,990
2,044
1,990
null
[]
None
null
0
0
0
null
0
null
The function (test_qmaxpool2d) defined within the public class called public.The function start at line 1990 and ends at 2044. It contains 22 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_qflatten.__init__
def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)self.relu = torch.nn.ReLU()self.adaptive_avg_pool2d = torch.nn.AdaptiveAvgPool2d((1, 1))
1
9
1
72
0
2,053
2,061
2,053
null
[]
None
null
0
0
0
null
0
null
The function (test_qflatten.__init__) defined within the public class called public.The function start at line 2053 and ends at 2061. 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_qflatten.forward
def forward(self, x):return torch.cat([torch.flatten(self.adaptive_avg_pool2d(self.relu(self.conv(x))), 1)])
1
8
2
38
0
2,063
2,070
2,063
null
[]
None
null
0
0
0
null
0
null
The function (test_qflatten.forward) defined within the public class called public.The function start at line 2063 and ends at 2070. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2063.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qflatten.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qreshape_matcher_count"], 0 if TEST_ACL else 1)
2
4
0
22
0
2,075
2,078
2,075
null
[]
None
null
0
0
0
null
0
null
The function (test_qflatten.matcher_check_fn) defined within the public class called public.The function start at line 2075 and ends at 2078. It contains 4 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_qflatten
def test_qflatten(self):r"""This testcase will quantize Conv2d->AdaptiveAvgPool2d->flatten->cat pattern."""class M(torch.nn.Module):def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)self.relu = torch.nn.ReLU()self.adaptive_avg_pool2d = torch.nn.Adapti...
1
13
1
81
0
2,047
2,085
2,047
null
[]
None
null
0
0
0
null
0
null
The function (test_qflatten) defined within the public class called public.The function start at line 2047 and ends at 2085. It contains 13 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_qcat.__init__
def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)self.conv2 = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)
1
10
1
77
0
2,103
2,112
2,103
null
[]
None
null
0
0
0
null
0
null
The function (test_qcat.__init__) defined within the public class called public.The function start at line 2103 and ends at 2112. It contains 10 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_qcat.forward
def forward(self, x):temp1 = self.conv(x)temp2 = self.conv2(torch.pow(x, 2))return torch.cat((temp1, temp2), 1)
1
4
2
43
0
2,114
2,117
2,114
null
[]
None
null
0
0
0
null
0
null
The function (test_qcat.forward) defined within the public class called public.The function start at line 2114 and ends at 2117. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2114.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qcat.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qcat_matcher_count"], 0 if TEST_ACL else 1)self.assertEqual(counters["inductor"]["qconv_weight_prepack_matcher_count"], 2)self.assertEqual(counters["inductor"]["qconv_unary_matcher_count"],0 if TEST_ACL else 2,)self.assertEqual(counters["inductor"]["qconv_un...
4
14
0
73
0
2,122
2,135
2,122
null
[]
None
null
0
0
0
null
0
null
The function (test_qcat.matcher_check_fn) defined within the public class called public.The function start at line 2122 and ends at 2135. It contains 14 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_qcat
def test_qcat(self):r"""This testcase will quantize cat based pattern:X / \Conv1(X)Pow(x)\\ \ Conv2(X)\/ Cat|Y"""class M(torch.nn.Module):def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, padding=3, dilation=1)self.conv2 = torch.nn.Conv2d(3, 64, 7, bias=True, stride=2, pad...
1
13
1
81
0
2,088
2,142
2,088
null
[]
None
null
0
0
0
null
0
null
The function (test_qcat) defined within the public class called public.The function start at line 2088 and ends at 2142. It contains 13 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_dynamic_fp16_helper.__init__
def __init__(self, bias: bool, use_relu: bool):super().__init__()self.linear = torch.nn.Linear(256, 256, bias=bias)self.relu = torch.nn.ReLU()self.use_relu = use_relu
1
5
3
54
0
2,146
2,150
2,146
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_dynamic_fp16_helper.__init__) defined within the public class called public.The function start at line 2146 and ends at 2150. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 3 parameters, represented as [2146.0] and does not return any value..
pytorch_ao
public
public
0
0
_test_linear_dynamic_fp16_helper.forward
def forward(self, x):if self.use_relu:return self.relu(self.linear(x))return self.linear(x)
2
4
2
31
0
2,152
2,155
2,152
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_dynamic_fp16_helper.forward) defined within the public class called public.The function start at line 2152 and ends at 2155. It contains 4 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2152.0] and does not return any value..
pytorch_ao
public
public
0
0
_test_linear_dynamic_fp16_helper.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 1)# Matched nodes:# (1) w to fp16, (2) w to fp32, (3) permute w, (4) mm/addmm/bmm# If x.ndim == 3 and x is contiguous, two view nodes are added.# If x.ndim == 3 and x is not contiguous, two expand nodes and one add nod...
5
16
0
62
0
2,174
2,193
2,174
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_dynamic_fp16_helper.matcher_check_fn) defined within the public class called public.The function start at line 2174 and ends at 2193. It contains 16 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_helper
def _test_linear_dynamic_fp16_helper(self, use_relu: bool):class M(torch.nn.Module):def __init__(self, bias: bool, use_relu: bool):super().__init__()self.linear = torch.nn.Linear(256, 256, bias=bias)self.relu = torch.nn.ReLU()self.use_relu = use_reludef forward(self, x):if self.use_relu:return self.relu(self.linear(x))...
5
43
2
225
0
2,144
2,216
2,144
null
[]
None
null
0
0
0
null
0
null
The function (_test_linear_dynamic_fp16_helper) defined within the public class called public.The function start at line 2144 and ends at 2216. It contains 43 lines of code and it has a cyclomatic complexity of 5. It takes 2 parameters, represented as [2144.0] and does not return any value..
pytorch_ao
public
public
0
0
test_linear_dynamic_fp16
def test_linear_dynamic_fp16(self):self._test_linear_dynamic_fp16_helper(use_relu=False)
1
2
1
13
0
2,220
2,221
2,220
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 2220 and ends at 2221. 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_relu_dynamic_fp16
def test_linear_relu_dynamic_fp16(self):self._test_linear_dynamic_fp16_helper(use_relu=True)
1
2
1
13
0
2,225
2,226
2,225
null
[]
None
null
0
0
0
null
0
null
The function (test_linear_relu_dynamic_fp16) defined within the public class called public.The function start at line 2225 and ends at 2226. 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_smooth_quant_with_int_mm.__init__
def __init__(self, dtype: torch.dtype, has_bias: bool, per_channel_quant: bool):super().__init__()self.dtype = dtypeself.has_bias = has_biasself.b = torch.randint(q_min, q_max, [in_feature, out_feature], dtype=torch.int8)self.per_channel_quant = per_channel_quanta_scale_per_tensor = torch.rand([1], dtype=dtype) * 0.01 ...
3
20
4
176
0
2,254
2,273
2,254
null
[]
None
null
0
0
0
null
0
null
The function (test_smooth_quant_with_int_mm.__init__) defined within the public class called public.The function start at line 2254 and ends at 2273. It contains 20 lines of code and it has a cyclomatic complexity of 3. It takes 4 parameters, represented as [2254.0] and does not return any value..
pytorch_ao
public
public
0
0
test_smooth_quant_with_int_mm.forward
def forward(self, a):out_shape = a.shape[:-1] + (self.b.size(-1),)a_reshaped = a.reshape(-1, a.size(-1))c = torch._int_mm(a_reshaped, self.b)c = c.to(self.dtype)c_shape = c.shapea_scale = self.a_scale.expand(c.shape)c = c * a_scalec = c * self.b_scaleif self.has_bias:c = c.reshape([1, *list(c_shape)])c = c + self.biasc...
2
15
2
144
0
2,275
2,289
2,275
null
[]
None
null
0
0
0
null
0
null
The function (test_smooth_quant_with_int_mm.forward) defined within the public class called public.The function start at line 2275 and ends at 2289. It contains 15 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2275.0] and does not return any value..
pytorch_ao
public
public
0
0
test_smooth_quant_with_int_mm.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 1)if dynamic:nodes_count = 10 if has_bias else 7else:nodes_count = 7 if has_bias else 6if counters["inductor"]["removed_pointless_view_pair"] == 0:# Removing pointless view pairs affect how the pattern# for this test i...
5
13
0
63
0
2,294
2,308
2,294
null
[]
None
null
0
0
0
null
0
null
The function (test_smooth_quant_with_int_mm.matcher_check_fn) defined within the public class called public.The function start at line 2294 and ends at 2308. It contains 13 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_smooth_quant_with_int_mm
def test_smooth_quant_with_int_mm(self, has_bias, dtype, per_channel_quant, dynamic):r"""This testcase check if we can match the SmoothQuant int8 linear pattern from Torchao.The pattern is:(no bias) reshape -> _int_mm -> convert_element_type -> (expand -> mul) -> mul -> reshapeor(with bias) pattern_no_bias -> add -> re...
3
22
5
133
0
2,236
2,316
2,236
null
[]
None
null
0
0
0
null
0
null
The function (test_smooth_quant_with_int_mm) defined within the public class called public.The function start at line 2236 and ends at 2316. It contains 22 lines of code and it has a cyclomatic complexity of 3. It takes 5 parameters, represented as [2236.0] and does not return any value..
pytorch_ao
public
public
0
0
test_da8w8_sym_act_sym_wgt_with_int_mm.__init__
def __init__(self, dtype: torch.dtype, has_bias: bool):super().__init__()self.dtype = dtypeself.has_bias = has_biasself.b = torch.randint(q_min, q_max, [in_feature, out_feature], dtype=torch.int8)self.a_scale = torch.rand([M, 1], dtype=dtype) * 0.01 + 0.01self.b_scale = torch.rand([out_feature]) * 0.01 + 0.01self.b_sca...
2
12
3
152
0
2,368
2,379
2,368
null
[]
None
null
0
0
0
null
0
null
The function (test_da8w8_sym_act_sym_wgt_with_int_mm.__init__) defined within the public class called public.The function start at line 2368 and ends at 2379. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 3 parameters, represented as [2368.0] and does not return any value..
pytorch_ao
public
public
0
0
test_da8w8_sym_act_sym_wgt_with_int_mm.forward
def forward(self, a):if reshape_a:a_reshaped = a.reshape(-1, a.size(-1))else:a_reshaped = ac = torch._int_mm(a_reshaped, self.b)c = c.to(self.dtype)if expand_a_scale:a_scale = self.a_scale.expand(c.shape)else:a_scale = self.a_scalec = c * a_scalec = c * self.b_scaleif self.has_bias:c = c + self.biaselif inplace_add and...
6
18
2
115
0
2,381
2,401
2,381
null
[]
None
null
0
0
0
null
0
null
The function (test_da8w8_sym_act_sym_wgt_with_int_mm.forward) defined within the public class called public.The function start at line 2381 and ends at 2401. It contains 18 lines of code and it has a cyclomatic complexity of 6. It takes 2 parameters, represented as [2381.0] and does not return any value..
pytorch_ao
public
public
0
0
test_da8w8_sym_act_sym_wgt_with_int_mm.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 1)
1
4
0
18
0
2,406
2,409
2,406
null
[]
None
null
0
0
0
null
0
null
The function (test_da8w8_sym_act_sym_wgt_with_int_mm.matcher_check_fn) defined within the public class called public.The function start at line 2406 and ends at 2409. 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_da8w8_sym_act_sym_wgt_with_int_mm
def test_da8w8_sym_act_sym_wgt_with_int_mm(self, has_bias, dtype, dynamic, reshape_a, M, inplace_add, expand_a_scale):r"""This testcase check if we can match the Int8DynamicActivationInt8WeightConfig int8 linear pattern from torchao,when activation is symmetrically quantized dynamically & weights are symmetrically quan...
11
34
8
181
0
2,335
2,419
2,335
null
[]
None
null
0
0
0
null
0
null
The function (test_da8w8_sym_act_sym_wgt_with_int_mm) defined within the public class called public.The function start at line 2335 and ends at 2419. It contains 34 lines of code and it has a cyclomatic complexity of 11. It takes 8 parameters, represented as [2335.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qconv2d_maxpool2d_linear_dynamic_cpu.__init__
def __init__(self,**kwargs,):super().__init__()self.conv = torch.nn.Conv2d(3, 16, (2, 2), stride=(1, 1), padding=(1, 1))self.relu = torch.nn.ReLU()self.maxpool2d = torch.nn.MaxPool2d(kernel_size=3, stride=2, padding=1)self.avgpool = torch.nn.AdaptiveAvgPool2d((1, 1))self.linear = torch.nn.Linear(16, 16)
1
12
2
115
0
2,438
2,449
2,438
null
[]
None
null
0
0
0
null
0
null
The function (test_qconv2d_maxpool2d_linear_dynamic_cpu.__init__) defined within the public class called public.The function start at line 2438 and ends at 2449. It contains 12 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2438.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qconv2d_maxpool2d_linear_dynamic_cpu.forward
def forward(self, x):temp = self.relu(self.conv(x))temp = self.maxpool2d(temp)temp = self.avgpool(temp)temp = torch.flatten(temp, 1)return self.linear(temp)
1
6
2
53
0
2,451
2,456
2,451
null
[]
None
null
0
0
0
null
0
null
The function (test_qconv2d_maxpool2d_linear_dynamic_cpu.forward) defined within the public class called public.The function start at line 2451 and ends at 2456. It contains 6 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2451.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qconv2d_maxpool2d_linear_dynamic_cpu
def test_qconv2d_maxpool2d_linear_dynamic_cpu(self, include_ops=None):r"""This testcase will quantize a single Conv2d->Maxpool2d->Linear modulewith dynamic batch size input."""class M(torch.nn.Module):def __init__(self,**kwargs,):super().__init__()self.conv = torch.nn.Conv2d(3, 16, (2, 2), stride=(1, 1), padding=(1, 1)...
2
21
2
108
0
2,431
2,474
2,431
null
[]
None
null
0
0
0
null
0
null
The function (test_qconv2d_maxpool2d_linear_dynamic_cpu) defined within the public class called public.The function start at line 2431 and ends at 2474. It contains 21 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2431.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qat_bn_conv2d.__init__
def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 3, 3)self.bn1 = torch.nn.BatchNorm2d(3)self.bn2 = torch.nn.BatchNorm2d(3)
1
7
1
53
0
2,484
2,490
2,484
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_bn_conv2d.__init__) defined within the public class called public.The function start at line 2484 and ends at 2490. It contains 7 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_bn_conv2d.forward
def forward(self, x):x = self.conv(self.bn1(x))return self.bn2(x)
1
3
2
27
0
2,492
2,494
2,492
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_bn_conv2d.forward) defined within the public class called public.The function start at line 2492 and ends at 2494. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2492.0] and does not return any value..
pytorch_ao
public
public
0
0
test_qat_bn_conv2d.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qconv_weight_prepack_matcher_count"], 1)
1
4
0
18
0
2,499
2,502
2,499
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_bn_conv2d.matcher_check_fn) defined within the public class called public.The function start at line 2499 and ends at 2502. 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_qat_bn_conv2d
def test_qat_bn_conv2d(self):r"""This testcase will quantize a single BN Conv2d module with qat flow."""class M(torch.nn.Module):def __init__(self,):super().__init__()self.conv = torch.nn.Conv2d(3, 3, 3)self.bn1 = torch.nn.BatchNorm2d(3)self.bn2 = torch.nn.BatchNorm2d(3)def forward(self, x):x = self.conv(self.bn1(x))re...
1
14
1
85
0
2,478
2,510
2,478
null
[]
None
null
0
0
0
null
0
null
The function (test_qat_bn_conv2d) defined within the public class called public.The function start at line 2478 and ends at 2510. 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_q_attention_block.__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 = torch.nn.Linear(input_dim, input_dim, bias=False)self.k_proj = torch.nn.Linear(input_dim, input_dim, bias=False)self.v_proj = torch.nn.Linear(input_...
2
19
5
133
0
2,516
2,534
2,516
null
[]
None
null
0
0
0
null
0
null
The function (test_q_attention_block.__init__) defined within the public class called public.The function start at line 2516 and ends at 2534. It contains 19 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [2516.0] and does not return any value..
pytorch_ao
public
public
0
0
test_q_attention_block.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
2,536
2,542
2,536
null
[]
None
null
0
0
0
null
0
null
The function (test_q_attention_block.transpose_for_scores) defined within the public class called public.The function start at line 2536 and ends at 2542. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [2536.0] and does not return any value..
pytorch_ao
public
public
0
0
test_q_attention_block.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
2,544
2,555
2,544
null
[]
None
null
0
0
0
null
0
null
The function (test_q_attention_block.forward) defined within the public class called public.The function start at line 2544 and ends at 2555. It contains 12 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [2544.0] and does not return any value..
pytorch_ao
public
public
0
0
test_q_attention_block.matcher_check_fn
def matcher_check_fn():self.assertEqual(counters["inductor"]["qlinear_weight_prepack_matcher_count"], 3)self.assertEqual(counters["inductor"]["qlinear_unary_matcher_count"],3 if annotate_matmul and not TEST_ACL else 0,)
3
8
0
40
0
2,566
2,573
2,566
null
[]
None
null
0
0
0
null
0
null
The function (test_q_attention_block.matcher_check_fn) defined within the public class called public.The function start at line 2566 and ends at 2573. It contains 8 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_q_attention_block
def test_q_attention_block(self):class SelfAttnLikeModule(torch.nn.Module):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 = torch.nn.Linear(input_dim, input_dim, bias=False)self.k_proj = torch.nn.L...
3
27
1
125
0
2,514
2,588
2,514
null
[]
None
null
0
0
0
null
0
null
The function (test_q_attention_block) defined within the public class called public.The function start at line 2514 and ends at 2588. It contains 27 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
__init__
def __init__(self, with_bn=False) -> None:super().__init__()self.conv = nn.Conv2d(3, 6, (2, 2), stride=(1, 1), padding=(1, 1))self.bn = torch.nn.BatchNorm2d(6)self.with_bn = with_bn
1
5
2
69
0
49
53
49
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 49 and ends at 53. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [49.0] 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)return x
2
5
2
30
0
55
59
55
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 55 and ends at 59. It contains 5 lines of code and it has a cyclomatic complexity of 2. It takes 2 parameters, represented as [55.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self, post_op, use_bias: bool = False, with_bn=False) -> None:super().__init__()self.conv = nn.Conv2d(3, 6, (2, 2), stride=(1, 1), padding=(1, 1), bias=use_bias)self.post_op = post_opself.bn = torch.nn.BatchNorm2d(6)self.with_bn = with_bnself.maxpool = torch.nn.MaxPool2d((3, 3))
1
9
4
102
0
62
70
62
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 62 and ends at 70. It contains 9 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [62.0] 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
2
7
2
46
0
72
78
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 72 and ends at 78. It contains 7 lines of code and it has a cyclomatic complexity of 2. 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,conv2d_type: NodePosType = NodePosType.left,use_bias: bool = False,with_bn: bool = False,) -> None:super().__init__()self.conv = torch.nn.Conv2d(in_channels=3,out_channels=3,kernel_size=3,stride=1,padding=1,bias=use_bias,)self.conv2 = torch.nn.Conv2d(in_channels=3,out_channel...
1
29
5
147
0
81
109
81
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 81 and ends at 109. It contains 29 lines of code and it has a cyclomatic complexity of 1. It takes 5 parameters, represented as [81.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):if self.conv2d_type == NodePosType.left:if self.inplace_add:tmp = self.conv(x)if self.with_bn:tmp = self.bn(tmp)tmp += self.relu(x)return tmpelse:tmp = self.conv(x)if self.with_bn:tmp = self.bn(tmp)return tmp + self.relu(x)elif self.conv2d_type == NodePosType.right:if self.inplace_add:tmp = self.re...
9
27
2
180
0
111
137
111
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 111 and ends at 137. It contains 27 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [111.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,inplace_add: bool = False,conv2d_type: NodePosType = NodePosType.left,inplace_relu: bool = False,use_bias: bool = False,with_bn: bool = False,) -> None:super().__init__()self.conv = torch.nn.Conv2d(in_channels=3,out_channels=3,kernel_size=3,stride=1,padding=1,bias=use_bias,)self.conv2 = torch.nn.Conv2...
1
31
6
165
0
140
170
140
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 140 and ends at 170. It contains 31 lines of code and it has a cyclomatic complexity of 1. It takes 6 parameters, represented as [140.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):if self.conv2d_type == NodePosType.left:if self.inplace_add:tmp = self.conv(x)if self.with_bn:tmp = self.bn(tmp)tmp += self.relu(x)return self.relu2(tmp)else:tmp = self.conv(x)if self.with_bn:tmp = self.bn(tmp)return self.relu2(tmp + self.relu(x))elif self.conv2d_type == NodePosType.right:if self.i...
9
27
2
210
0
172
198
172
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 172 and ends at 198. It contains 27 lines of code and it has a cyclomatic complexity of 9. It takes 2 parameters, represented as [172.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self, single_op):super().__init__()self.conv = nn.Conv2d(2, 2, 1)self.single_op = single_op
1
4
2
33
0
201
204
201
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 201 and ends at 204. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [201.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):x = self.conv(x)x = self.single_op(x)return torch.pow(x, 2)
1
4
2
32
0
206
209
206
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 206 and ends at 209. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [206.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,) -> None:super().__init__()self.conv = torch.nn.Conv2d(in_channels=3,out_channels=3,kernel_size=3,stride=1,padding=1,bias=True,)self.conv2 = torch.nn.Conv2d(in_channels=3,out_channels=3,kernel_size=3,stride=1,padding=1,bias=True,)self.conv3 = torch.nn.Conv2d(in_channels=3,out_channels=3,kernel_size=3...
1
38
1
173
0
214
251
214
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 214 and ends at 251. 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
forward
def forward(self, x):x1 = self.conv(x)res1 = self.relu(self.conv2(x1) + self.conv3(x1))res2 = self.relu2(self.conv4(res1) + res1)return res2
1
5
2
52
0
253
257
253
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 253 and ends at 257. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [253.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.conv2 = torch.nn.Conv2d(3, 16, 7, bias=True, stride=2, padding=3, dilation=1)self.relu = torch.nn.ReLU()self.maxpool = torch.nn.MaxPool2d(3, stride=2, padding=1)self.conv3 = torch.nn.Conv2d(32, 32...
1
15
1
140
0
260
274
260
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 260 and ends at 274. It contains 15 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):temp1 = self.relu(self.conv(x))temp2 = self.conv2(x + 1)temp3 = torch.cat((temp1, temp2), 1)temp4 = self.maxpool(temp3)temp5 = self.conv3(temp4)return temp5
1
7
2
62
0
276
282
276
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 276 and ends at 282. It contains 7 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [276.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.avgpool = torch.nn.AvgPool2d(3, stride=2, padding=1)
1
8
1
65
0
285
292
285
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 285 and ends at 292. 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
forward
def forward(self, x):temp1 = self.avgpool(self.conv(x))return temp1
1
3
2
22
0
294
296
294
null
[]
None
null
0
0
0
null
0
null
The function (forward) 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..
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
8
1
56
0
299
306
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 299 and ends at 306. 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
forward
def forward(self, x):temp1 = self.relu(self.conv(x))temp3 = torch.cat((temp1, temp1), 1)return temp3
1
4
2
36
0
308
311
308
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 308 and ends at 311. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [308.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
8
1
56
0
314
321
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 314 and ends at 321. 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
forward
def forward(self, x):temp1 = self.relu(self.conv(x))temp3 = torch.cat((temp1,), 1)return temp3
1
4
2
35
0
323
326
323
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 323 and ends at 326. It contains 4 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [323.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self, use_bias) -> None:super().__init__()self.linear = nn.Linear(4, 4, bias=use_bias)
1
3
2
32
0
329
331
329
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 329 and ends at 331. It contains 3 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [329.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):return self.linear(x)
1
2
2
14
0
333
334
333
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 333 and ends at 334. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [333.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self, use_bias, postop, inplace_postop=False, post_op_algo="none") -> None:super().__init__()self.linear = nn.Linear(4, 4, bias=use_bias)if postop == nn.GELU:self.postop = postop(approximate=post_op_algo)else:self.postop = postop(inplace=inplace_postop)
2
9
5
71
0
337
345
337
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 337 and ends at 345. It contains 9 lines of code and it has a cyclomatic complexity of 2. It takes 5 parameters, represented as [337.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):return self.postop(self.linear(x))
1
2
2
19
0
347
348
347
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 347 and ends at 348. It contains 2 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [347.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,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)self.relu = nn.ReLU()self.i...
1
16
4
98
0
351
366
351
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 351 and ends at 366. It contains 16 lines of code and it has a cyclomatic complexity of 1. It takes 4 parameters, represented as [351.0] and does not return any value..
pytorch_ao
public
public
0
0
forward
def forward(self, x):if self.linear_pos == NodePosType.left:if self.inplace_add:tmp = self.linear(x)tmp += self.relu(x)return tmpelse:tmp = self.linear(x)return tmp + self.relu(x)elif self.linear_pos == NodePosType.right:if self.inplace_add:tmp = self.relu(x)tmp += self.linear(x)return tmpelse:return self.relu(x) + sel...
7
23
2
154
0
368
390
368
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 368 and ends at 390. It contains 23 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [368.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
18
5
116
0
393
410
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 393 and ends at 410. It contains 18 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):if self.linear_pos == NodePosType.left:if self.inplace_add:tmp = self.linear(x)tmp += self.relu(x)return self.relu2(tmp)else:tmp = self.linear(x)return self.relu2(tmp + self.relu(x))elif self.linear_pos == NodePosType.right:if self.inplace_add:tmp = self.relu(x)tmp += self.linear(x)return self.relu...
7
23
2
184
0
412
434
412
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 412 and ends at 434. It contains 23 lines of code and it has a cyclomatic complexity of 7. It takes 2 parameters, represented as [412.0] and does not return any value..
pytorch_ao
public
public
0
0
__init__
def __init__(self,) -> None:super().__init__()self.linear = torch.nn.Linear(in_features=16, out_features=16, bias=True)self.linear2 = torch.nn.Linear(in_features=16, out_features=16, bias=True)self.linear3 = torch.nn.Linear(in_features=16, out_features=16, bias=True)self.linear4 = torch.nn.Linear(in_features=16, out_fe...
1
10
1
121
0
439
448
439
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 439 and ends at 448. It contains 10 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):x1 = self.conv(x)res1 = self.relu(self.conv2(x1) + self.conv3(x1))res2 = self.relu2(self.conv4(res1) + res1)return res2
1
5
2
52
0
450
454
253
null
[]
None
null
0
0
0
null
0
null
The function (forward) defined within the public class called public.The function start at line 450 and ends at 454. It contains 5 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [253.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.linear = torch.nn.Linear(in_features=16, out_features=16, bias=True)self.linear2 = torch.nn.Linear(in_features=16, out_features=16, bias=True)self.inplace_add = inplace_add
1
8
2
70
0
457
464
457
null
[]
None
null
0
0
0
null
0
null
The function (__init__) defined within the public class called public.The function start at line 457 and ends at 464. It contains 8 lines of code and it has a cyclomatic complexity of 1. It takes 2 parameters, represented as [457.0] and does not return any value..