MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / forward

Method forward

src/shape_assembly/models/encoder/vn_layers.py:153–164  ·  view source on GitHub ↗

x: point features of shape [B, N_feat, 3, N_samples, ...]

(self, x)

Source from the content-addressed store, hash-verified

151 self.bn = nn.BatchNorm2d(num_features)
152
153 def forward(self, x):
154 '''
155 x: point features of shape [B, N_feat, 3, N_samples, ...]
156 '''
157 # norm = torch.sqrt((x*x).sum(2))
158 norm = torch.norm(x, dim=2) + EPS
159 norm_bn = self.bn(norm)
160 norm = norm.unsqueeze(2)
161 norm_bn = norm_bn.unsqueeze(2)
162 x = x / norm * norm_bn
163
164 return x
165
166
167class VNMaxPool(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected