Skip to content

Mismatch between returned value type and eltype for Float16 data #308

Description

@lcontento

When interpolating Float16 data, the interpolator reports its element type as Float64 even if it correctly returns Float16 data when called.

julia> using Interpolations

julia> itp = interpolate(rand(Float16, 3, 3), BSpline(Linear()));

julia> isa(itp, Interpolations.BSplineInterpolation{Float16})
false

julia> eltype(itp)
Float64

julia> itp(Float16(1.1), Float16(1.1))
Float16(0.9077)

It looks to be due to the tweight function defaulting to Float64 and I can apparently solve the problem by specializing tweight for Float16 or changing its default value to be the same type as the input array. Since I am not very familiar with the codebase I am not sure if that's all it should be done.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions