You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spec/API_specification/data_types.md
+39-4
Original file line number
Diff line number
Diff line change
@@ -64,14 +64,49 @@ for more details.
64
64
:::
65
65
66
66
```{note}
67
-
Data types ("dtypes") are objects that can be used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`). A conforming implementation may add methods or attributes to data type objects; however, these methods and attributes are not included in this specification.
67
+
A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification.
68
+
```
68
69
69
-
Implementations may provide other ways to specify data types (e.g.,
70
-
`zeros((2, 3), dtype='f4')`); however, these are not included in this specification.
70
+
(data-type-objects)=
71
+
## Data Type Objects
71
72
72
-
A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification.
73
+
Data types ("dtypes") are objects which are used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`).
74
+
75
+
```{note}
76
+
A conforming implementation may add additional methods or attributes to data type objects beyond those described in this specification.
73
77
```
74
78
79
+
```{note}
80
+
Implementations may provide other ways to specify data types (e.g., `zeros((2, 3), dtype='f4')`) which are not described in this specification; however, in order to ensure portability, array library consumers are recommended to use data type objects as provided by specification conforming array libraries.
81
+
```
82
+
83
+
A conforming implementation of the array API standard must provide and support data type objects having the following attributes and methods.
84
+
85
+
### Methods
86
+
87
+
<!-- NOTE: please keep the methods in alphabetical order -->
88
+
89
+
(data-type-method-__eq__)=
90
+
### \_\_eq\_\_(self, other, /)
91
+
92
+
Computes the truth value of `self == other` in order to test for data type object equality.
93
+
94
+
#### Parameters
95
+
96
+
-**self**: _<dtype>_
97
+
98
+
- data type instance. May be any supported data type.
99
+
100
+
-**other**: _<dtype>_
101
+
102
+
- other data type instance. May be any supported data type.
103
+
104
+
#### Returns
105
+
106
+
-**out**: _<bool>_
107
+
108
+
- a boolean indicating whether the data type objects are equal.
0 commit comments