| 21 | |
| 22 | |
| 23 | class VNLinear(nn.Module): |
| 24 | def __init__(self, in_channels, out_channels): |
| 25 | super(VNLinear, self).__init__() |
| 26 | self.map_to_feat = nn.Linear(in_channels, out_channels, bias=False) |
| 27 | |
| 28 | def forward(self, x): |
| 29 | ''' |
| 30 | x: point features of shape [B, N_feat, 3, N_samples, ...] |
| 31 | ''' |
| 32 | x_out = self.map_to_feat(x.transpose(1, -1)).transpose(1, -1) |
| 33 | return x_out |
| 34 | |
| 35 | |
| 36 | class VNLeakyReLU(nn.Module): |