Thank you! for the help.
I am not nearly as familiar with the backward() function, but I gave it a shot.How would you change this?
class TransferGradient(Function):
        @staticmethod
        def forward(ctx, source, target):
            ctx.srce_ = source
            ctx.tgt_ = target
            return target
        
        @staticmethod
        def backward(ctx, *grad_outputs):
            # I do not think this is right. What would need to be changed here?
            grad_outputs[0] = grad_outputs[0] * ctx.tgt_
            return ctx.srce_.backward(ctx, *grad_outputs)

        @staticmethod
        def __call__(*args):
            return TransferGradient.apply(*args)

Thank you again.