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

Method forward

modules/functional/sampling.py:12–25  ·  view source on GitHub ↗

Gather :param ctx: :param features: features of points, FloatTensor[B, C, N] :param indices: centers' indices in points, IntTensor[b, m] :return: centers_coords: coordinates of sampled centers, FloatTensor[B, C, M]

(ctx, features, indices)

Source from the content-addressed store, hash-verified

10class Gather(Function):
11 @staticmethod
12 def forward(ctx, features, indices):
13 """
14 Gather
15 :param ctx:
16 :param features: features of points, FloatTensor[B, C, N]
17 :param indices: centers' indices in points, IntTensor[b, m]
18 :return:
19 centers_coords: coordinates of sampled centers, FloatTensor[B, C, M]
20 """
21 features = features.contiguous()
22 indices = indices.int().contiguous()
23 ctx.save_for_backward(indices)
24 ctx.num_points = features.size(-1)
25 return _backend.gather_features_forward(features, indices)
26
27 @staticmethod
28 def backward(ctx, grad_output):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected