Skip to content

Supported data types #15

Closed
Closed
@kgryte

Description

@kgryte

This issue seeks to come to a consensus on the minimum set of data types an array library must support in order to conform to the specification.

Prior Art

Supported data types across array libraries...

  • NumPy
bool_
bool8
byte
short
intc
int_
longlong
intp
int8
int16
int32
int64
ubyte
ushort
uintc
uint
ulonglong
uintp
uint8
uint16
uint32
uint64
half
single
double
float_
longfloat
float16
float32
float64
float96
float128
csingle
complex_
clongfloat
complex64
complex128
complex192
complex256
object_
bytes_
unicode_
void
  • PyTorch
bfloat16
bool
complex64
complex128
float16
float32
float64
int8
int16
int32
int64
uint8
  • Tensorflow
bool
bfloat16
complex64
complex128
float16
float32
float64
int16
int32
int64
qint8
qint16
qint32
quint8
quint16
string
uint8
uint16
uint32
uint64
  • JAX
bool
bfloat16
complex64
complex128
float16
float32
float64
int8
int16
int32
int64
uint8
uint16
uint32
uint64
  • CuPy
bool_
complex64
complex128
float16
float32
float64
int8
int16
int32
int64
uint8
uint16
uint32
uint64
  • Dask (see NumPy)

  • MXNet (see NumPy)

  • PyData/Sparse (see NumPy)

Proposal

This issue proposes to specify that all specification conforming array libraries must, at minimum, support the following data types:

bool

int8
int16
int32
int64

uint8
uint16
uint32
uint64

float32
float64

The above data types are common across all array libraries considered in prior art (with PyTorch being the exception).

Notes

  • complex64 and complex128 are currently omitted from this proposal, as I'd like to defer consideration of some of the thornier aspects of how complex numbers are handled for future specification iterations. The proposed types have considerable prior art and are well-established, and, when questions arise regarding their behavior, normative references, such as IEEE 754 for floating-point arithmetic, are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions