dtypes
dtypes
¤
DataType
¤
Bases: IntEnum
The available symbolic data types. Note that these data types are precision-agnostic.
Source code in cirkit/symbolic/dtypes.py
7 8 9 10 11 12 13 14 15 | |
dtype_value(x)
¤
Given a number or Numpy array, return its symbolic data type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
Number | ndarray
|
A number, which can be a Python integer, float or complex number. Alternatively, it can be a Numpy array. |
required |
Returns:
| Type | Description |
|---|---|
DataType
|
The symbolic data type associated to the given number or Numpy array. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the given number is neither an integer, nor a float, nor a complex number, nor a Numpy array. |
Source code in cirkit/symbolic/dtypes.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |