Skip to content

Flux.params for primitive types #1991

@FelixBenning

Description

@FelixBenning

Flux.params does not work for primitive types, e.g.

Screenshot 2022-06-07 at 10 14 45

I assume this is because Zygote uses the pointer to the arrays to identify the array and differentiate with regard to every usage of that pointer. Primitive types do not have a pointer stored in the struct but the element itself so this method breaks.

Ideally Primitive types are supported (the pointer is the pointer to the model struct + offset)

But it might be more realistic to use the output of Flux.functor(model) to print a warning about any primitive (or otherwise incompatible) types when Flux.params is used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions