MCPcopy Create free account
hub / github.com/Anoise/WTFlib / __init__

Method __init__

LDPS_Graph/layers/PatchTST_backbone.py:315–327  ·  view source on GitHub ↗
(self, in_channels, out_channels, K, bias=True)

Source from the content-addressed store, hash-verified

313 """
314
315 def __init__(self, in_channels, out_channels, K, bias=True):
316 super(DConv, self).__init__(aggr="add", flow="source_to_target")
317 assert K > 0
318 self.in_channels = in_channels
319 self.out_channels = out_channels
320 self.weight = torch.nn.Parameter(torch.Tensor(2, K, in_channels, out_channels))
321
322 if bias:
323 self.bias = torch.nn.Parameter(torch.Tensor(out_channels))
324 else:
325 self.register_parameter("bias", None)
326
327 self.__reset_parameters()
328
329 def __reset_parameters(self):
330 torch.nn.init.xavier_uniform_(self.weight)

Callers 9

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

__reset_parametersMethod · 0.95

Tested by

no test coverage detected