Skip to content

Add a result_type function to the API specification #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions spec/API_specification/utility_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,27 @@ Tests whether any input array element evaluates to `True` along a specified axis
- **out**: _<array>_

- if a logical OR reduction was performed over the entire array, the returned array must be a zero-dimensional array containing the test result; otherwise, the returned array must be a non-zero-dimensional array containing the test results. The returned array must have a data type of `bool`.


(function-result_type)=
### result_type(*arrays_and_dtypes)

Returns the dtype that results from applying the type promotion rules
(see {ref}`type-promotion`) to the arguments.

```{note}
If mixed dtypes (e.g. integer and floating-point) are used, the output of
`result_type` will be implementation-specific.
```

#### Parameters

- **arrays_and_dtypes**: _Sequence\[Union\[<array>, <dtype>\]\];_

- input arrays and dtypes.

#### Returns

- **out**: _<dtype>_

- the dtype resulting from an operation involving the input arrays and dtypes.