MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / __init__

Method __init__

modules/pointnet.py:12–30  ·  view source on GitHub ↗
(self, in_channels, out_channels, include_coordinates=True)

Source from the content-addressed store, hash-verified

10
11class PointNetAModule(nn.Module):
12 def __init__(self, in_channels, out_channels, include_coordinates=True):
13 super().__init__()
14 if not isinstance(out_channels, (list, tuple)):
15 out_channels = [[out_channels]]
16 elif not isinstance(out_channels[0], (list, tuple)):
17 out_channels = [out_channels]
18
19 mlps = []
20 total_out_channels = 0
21 for _out_channels in out_channels:
22 mlps.append(
23 SharedMLP(in_channels=in_channels + (3 if include_coordinates else 0),
24 out_channels=_out_channels, dim=1)
25 )
26 total_out_channels += _out_channels[-1]
27
28 self.include_coordinates = include_coordinates
29 self.out_channels = total_out_channels
30 self.mlps = nn.ModuleList(mlps)
31
32 def forward(self, inputs):
33 features, coords = inputs

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 1

SharedMLPClass · 0.90

Tested by

no test coverage detected