{ } Raw JSON

bundles / scipy 1.18.0 / scipy / _lib / _array_api / xp_promote

function

scipy._lib._array_api:xp_promote

source: /scipy/_lib/_array_api.py:544

Signature

def xp_promote(*args, broadcast = False, force_floating = False, xp)

Summary

Promotes elements of *args to result dtype, ignoring None's. Includes options for forcing promotion to floating point and broadcasting the arrays, again ignoring 'None's. Type promotion rules follow 'xp_result_type instead of xp.result_type.

Extended Summary

Typically, this function will be called shortly after array_namespace on a subset of the arguments passed to array_namespace.

This function accepts array-like iterables, which are immediately converted to the namespace's arrays before result type calculation. Consequently, the result dtype may be different when an argument is 1. vs [1.].

See also

xp_result_type

Aliases

  • scipy.differentiate.xp_promote