Skip to content

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

Open

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));
    }

Activity

  1. changed the title [-]Remove any unnecessary Contracts.Assert covered by Span<T> in hardware intrinsics APIs[/-] [+]CpuMath Enhancement: Remove any unnecessary Contracts.Assert covered by Span<T> in hardware intrinsics APIs[/+] on Sep 6, 2018
  2. added
    Priority:3Work that is nice to have
    area-NativeNative libraries, platform support, and architecture-specific code
    and removed on Sep 8, 2026
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

    Priority:3Work that is nice to havearea-NativeNative libraries, platform support, and architecture-specific codegreendevelopment

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions