mlx.core.divmod

目錄

mlx.core.divmod#

divmod(a: scalar | array, b: scalar | array, stream: None | Stream | Device = None) array#

Element-wise quotient and remainder.

The fuction divmod(a, b) is equivalent to but faster than (a // b, a % b). The function uses numpy-style broadcasting semantics. Either or both input arrays can also be scalars.

參數:
  • a (array) -- Input array or scalar.

  • b (array) -- Input array or scalar.

回傳:

The quotient a // b and remainder a % b.

回傳型別:

tuple(array, array)