Skip to content

Teach Tangent{T} about NoTangent vs ZeroTangent? #481

Open
@oxinabox

Description

@oxinabox

Right now canonicalizing at Tangent{T} inserts ZeroTangent for all fields of the T that don't have explict tangents recorded.
As does getproperty.
This is correct in that they don't have anything recorded as they don't get used to determine the output -- which is what ZeroTangent represents.
But it is also true for if the primal field is Char or Bool or Int or Symbol etc that they don't have a tangent space at all so NoTangent is also correct, and kinda more expected.

We can't always get it right just from the primal type, since it could be a indicator float etc.
But we can probably do pretty well

Metadata

Metadata

Assignees

No one assigned

    Labels

    Structural TangentRelated to the `Tangent` type for structured (composite) values

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions