MCPcopy Create free account
hub / github.com/pytorch/pytorch / __init__

Method __init__

test/test_mobile_optimizer.py:56–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

54
55 class MyTestModule(torch.nn.Module):
56 def __init__(self):
57 super().__init__()
58 self.conv_weight = torch.nn.Parameter(torch.rand(conv_weight_shape))
59 self.conv_bias = torch.nn.Parameter(torch.rand(conv_bias_shape))
60 self.linear_weight = torch.nn.Parameter(torch.rand(linear_weight_shape))
61 self.linear_bias = torch.nn.Parameter(torch.rand(weight_output_dim))
62 self.strides = strides
63 self.paddings = paddings
64 self.dilations = dilations
65 self.groups = groups
66
67 def forward(self, x):
68 o = F.conv2d(x, self.conv_weight, self.conv_bias,

Callers

nothing calls this directly

Calls 5

MyInnerTestModuleClass · 0.85
DropoutMethod · 0.80
TensorMethod · 0.80
__init__Method · 0.45
randMethod · 0.45

Tested by

no test coverage detected