Skip to content

Mooncake scalar_pullback overwrites tangent instead of accumulating #543

Description

@lkdvos

scalar_pullback does first(blocks(dt))[2][1] = Δval (plain assignment) instead of accumulating, unlike every other rule in this extension (increment!!/in-place +=). If the tensor fed to scalar(t) is also used elsewhere in the same reverse pass, one pullback's contribution silently clobbers the other's — wrong gradient, no error.

ext/TensorKitMooncakeExt/tensoroperations.jl:196-204. Fix: first(blocks(dt))[2][1] += Δval.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions