Table of Contents

Class ArrayMethodContext

Namespace
NumSharp
Assembly
NumSharp.dll

NEP 43's PyArrayMethod_Context: the method being run plus the resolved descriptors — what a strided loop receives so it can read parameters (a datetime unit) without re-resolving.

public sealed class ArrayMethodContext
Inheritance
ArrayMethodContext
Inherited Members

Remarks

The members are the struct's fields, method and descriptors (dtype_api.h). Not ported: caller (the ufunc a NumPy loop is called for; NumSharp's loops run without a caller object) and the NumPy 2.4 fields _reserved and flags. NumSharp adds NumSharp.ArrayMethodContext.Allocators: a StringDType operand's string allocator, which NumPy reaches through the descriptor and NumSharp keeps on the operand's buffer.

Constructors

ArrayMethodContext(ArrayMethod, IReadOnlyList<DType>)

Builds the context of one call of method.

public ArrayMethodContext(ArrayMethod method, IReadOnlyList<DType> descriptors)

Parameters

method ArrayMethod

The method being run.

descriptors IReadOnlyList<DType>

The resolved operand descriptors (inputs first, then outputs).

Exceptions

ArgumentNullException

method or descriptors is null.

Properties

descriptors

The resolved operand descriptors (inputs first, then outputs) — NumPy's descriptors.

public IReadOnlyList<DType> descriptors { get; }

Property Value

IReadOnlyList<DType>

method

The method this context belongs to — NumPy's method.

public ArrayMethod method { get; }

Property Value

ArrayMethod