def forward(ctx, input, offsets): ctx.offsets = offsets return C.revert_varlen_tensor(input, offsets)
def backward(ctx, grad_output): return C.revert_varlen_tensor(grad_output, ctx.offsets), None
def forward(ctx, input, lengths): ctx.lengths = lengths return C.revert_varlen_tensor(input, lengths)