diff --git a/spec/API_specification/data_type_functions.md b/spec/API_specification/data_type_functions.md index 18269d2f1..125bca50b 100644 --- a/spec/API_specification/data_type_functions.md +++ b/spec/API_specification/data_type_functions.md @@ -7,6 +7,68 @@ A conforming implementation of the array API standard must provide and support t ## Objects in API +(function-broadcast-arrays)= +### broadcast_arrays(\*args, /) + +Broadcasts one or more arrays against one another. + +#### Parameters + +- **\*args**: _Sequence\[ <array> ]_ + + - arrays to broadcast. + +#### Returns + +- **out**: _List\[ <array> ]_ + + - a list of broadcasted arrays. Each array must have the same shape. Each array must have the same dtype as its corresponding input array. + +(function-broadcast-to)= +### broadcast_to(x, shape, /) + +Broadcasts an array to a specified shape. + +#### Parameters + +- **x**: _<array>_ + + - array to broadcast. + +- **shape**: _Tuple\[int, ...]_ + + - array shape. Must be compatible with `x` (see {ref}`broadcasting`). + +#### Returns + +- **out**: _<array>_ + + - an array having a specified shape. Must have the same data type as `x`. + +#### Raises + +- if the array is incompatible with the specified shape (see {ref}`broadcasting`). + +(function-can-cast)= +### can_cast(from, to, /) + +Determines if one data type can be cast to another data type according {ref}`type-promotion` rules. + +#### Parameters + +- **from**: _Union\[ <dtype>, <array>]_ + + - input data type or array from which to cast. + +- **to**: _<dtype>_ + + - desired data type. + +#### Returns + +- **out**: _bool_ + + - `True` if the cast can occur according to {ref}`type-promotion` rules; otherwise, `False`. (finfo)= ### finfo(type, /)