Table of Contents

Struct ElementReductionKernelKey

Namespace
NumSharp.Backends.Kernels
Assembly
NumSharp.dll

Cache key for element-wise (full array) reduction kernels. Reduces all elements to a single scalar value.

public readonly record struct ElementReductionKernelKey : IEquatable<ElementReductionKernelKey>
Implements
Inherited Members
Extension Methods

Remarks

Supports up to 144 unique kernels: 12 types × 8 operations × 1 path

Constructors

ElementReductionKernelKey(NPTypeCode, NPTypeCode, ReductionOp, bool)

Cache key for element-wise (full array) reduction kernels. Reduces all elements to a single scalar value.

public ElementReductionKernelKey(NPTypeCode InputType, NPTypeCode AccumulatorType, ReductionOp Op, bool IsContiguous)

Parameters

InputType NPTypeCode
AccumulatorType NPTypeCode
Op ReductionOp
IsContiguous bool

Remarks

Supports up to 144 unique kernels: 12 types × 8 operations × 1 path

Properties

AccumulatorType

public NPTypeCode AccumulatorType { get; init; }

Property Value

NPTypeCode

InputType

public NPTypeCode InputType { get; init; }

Property Value

NPTypeCode

IsContiguous

public bool IsContiguous { get; init; }

Property Value

bool

IsSameType

Returns true if input and accumulator types are the same.

public bool IsSameType { get; }

Property Value

bool

Op

public ReductionOp Op { get; init; }

Property Value

ReductionOp

ResultType

Result type depends on operation:

  • ArgMax/ArgMin: always Int32
  • All/Any: always Boolean
  • Mean: always Double (or accumulator type if specified)
  • Others: same as accumulator type
public NPTypeCode ResultType { get; }

Property Value

NPTypeCode

Methods

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.