예제 #1
0
 def forward(ctx, input, offsets):
    ctx.offsets = offsets
    return C.revert_varlen_tensor(input, offsets)
예제 #2
0
 def backward(ctx, grad_output):
     return C.revert_varlen_tensor(grad_output, ctx.offsets), None
예제 #3
0
 def forward(ctx, input, lengths):
     ctx.lengths = lengths
     return C.revert_varlen_tensor(input, lengths)