Table of Contents

Enum NewSubtypeZeroDim

Namespace
NumSharp
Assembly
NumSharp.dll

How an ndarray method's 0-d result reaches the caller (NumSharp.NewSubtypeAttribute.ZeroDim): the third argument of __array_finalize__(NDArray, bool, NewSubtypeZeroDim), which a subclass reads to decide whether a 0-d result stays an array of its class or becomes the element it stands for.

public enum NewSubtypeZeroDim

Fields

Array = 0

A 0-d result is a 0-d array of the class, like any other rank.

Scalar = 1

PyArray_Return: a 0-d result is the NumPy scalar of the element, created as the subclass first (so the finalize rule runs on its dtype) and then converted - ndarray.take's unstripped np.str_.

Element = 2

The function ends by INDEXING the operand (np.flip's m[indexer]): a 0-d result is what the subclass's getitem returns for an element (a chararray's stripped Python str).

Remarks

Public because the hook it is passed to can be overridden outside NumSharp.dll; a subclass that has no scalar form of its own treats every value as Array.