MCPcopy Create free account
hub / github.com/Pointcept/PointTransformerV3 / forward

Method forward

model.py:227–252  ·  view source on GitHub ↗
(self, input)

Source from the content-addressed store, hash-verified

225 self.add_module(name, module)
226
227 def forward(self, input):
228 for k, module in self._modules.items():
229 # Point module
230 if isinstance(module, PointModule):
231 input = module(input)
232 # Spconv module
233 elif spconv.modules.is_spconv_module(module):
234 if isinstance(input, Point):
235 input.sparse_conv_feat = module(input.sparse_conv_feat)
236 input.feat = input.sparse_conv_feat.features
237 else:
238 input = module(input)
239 # PyTorch module
240 else:
241 if isinstance(input, Point):
242 input.feat = module(input.feat)
243 if "sparse_conv_feat" in input.keys():
244 input.sparse_conv_feat = input.sparse_conv_feat.replace_feature(
245 input.feat
246 )
247 elif isinstance(input, spconv.SparseConvTensor):
248 if input.indices.shape[0] != 0:
249 input = input.replace_feature(module(input.features))
250 else:
251 input = module(input)
252 return input
253
254
255class PDNorm(PointModule):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected