MCPcopy Create free account
hub / github.com/OpenImagingLab/4DSloMo / forward

Method forward

pointops2/functions/pointops_ablation.py:136–146  ·  view source on GitHub ↗

input: input: (n, c), position: (n, nsample, c), weight : (n, nsample, c'), idx: (n, nsample) output: (n, c)

(ctx, input, position, weight, idx)

Source from the content-addressed store, hash-verified

134class Aggregation(Function):
135 @staticmethod
136 def forward(ctx, input, position, weight, idx):
137 """
138 input: input: (n, c), position: (n, nsample, c), weight : (n, nsample, c'), idx: (n, nsample)
139 output: (n, c)
140 """
141 assert input.is_contiguous() and position.is_contiguous() and weight.is_contiguous()
142 n, nsample, c = position.shape; w_c = weight.shape[-1]
143 output = torch.cuda.FloatTensor(n, c).zero_()
144 pointops_cuda.aggregation_forward_cuda(n, nsample, c, w_c, input, position, weight, idx, output)
145 ctx.save_for_backward(input, position, weight, idx)
146 return output
147
148 @staticmethod
149 def backward(ctx, grad_output):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected