Skip to content

CpuMath Enhancement: Remove any unnecessary Contracts.Assert covered by Span<T> in hardware intrinsics APIs #827

Open
@briancylui

Description

@briancylui

Style changes needed to solve part of #823

Details

  • In src\Microsoft.ML.CpuMath\CpuMathUtils.netcoreapp.cs, Span<T> might already do the checks (Contracts.Assert) in the public functions. Reference:
    public static void Scale(float a, float[] dst, int offset, int count)
    {
    Contracts.AssertNonEmpty(dst);
    Contracts.Assert(count > 0);
    Contracts.Assert(offset >= 0);
    Contracts.Assert(offset < (dst.Length - count));
    Scale(a, new Span<float>(dst, offset, count));
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Doc bugs, questions, minor issues, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions