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

Method forward

src/shape_assembly/models/encoder/vn_layers.py:172–181  ·  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

170 self.map_to_dir = nn.Linear(in_channels, in_channels, bias=False)
171
172 def forward(self, x):
173 '''
174 x: point features of shape [B, N_feat, 3, N_samples, ...]
175 '''
176 d = self.map_to_dir(x.transpose(1, -1)).transpose(1, -1)
177 dotprod = (x * d).sum(2, keepdims=True)
178 idx = dotprod.max(dim=-1, keepdim=False)[1]
179 index_tuple = torch.meshgrid([torch.arange(j) for j in x.size()[:-1]]) + (idx,)
180 x_max = x[index_tuple]
181 return x_max
182
183
184def mean_pool(x, dim=-1, keepdim=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected