MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / forward

Method forward

modules/networks.py:97–126  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

95 self.padding_mode=padding_mode
96
97 def forward(self, x):
98 w= torch._weight_norm(self.weight, self.g, 0)
99
100
101
102 if self.padding_mode != 'zeros':
103 x= F.pad(x, (self.padding_amount,self.padding_amount), mode=self.padding_mode)
104
105 x= F.conv1d(
106 x,
107 w,
108 bias=self.bias,
109 stride=self.stride,
110 padding=0,
111 dilation=self.dilation,
112 groups=self.groups,
113 )
114 # print("x after conv", x.shape)
115 return x
116 else:
117
118 return F.conv1d(
119 x,
120 w,
121 bias=self.bias,
122 stride=self.stride,
123 padding=self.padding,
124 dilation=self.dilation,
125 groups=self.groups,
126 )
127
128
129def kaiming_init(m, is_linear, nonlinearity="silu"):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected