Skip to content

Add option to throw error on passing wrong precision floats to layers #2454

Open
@lassepe

Description

@lassepe

Motivation and description

The warning about wrong precision is very helpful to point at potential performance issues

@warn "Layer with Float32 parameters got Float64 input.

I think that this is the correct default behavior. However, in order to find out where the problem is coming from throwing an error to produce a stacktrace would be very helpful.

Possible Implementation

There could be a Preference or global flag that allows switching errors instead of warning for wrong precision inputs. This would also be made consistent with CUDA.allowscalar.

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