Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.floor_divide

jax.numpy.floor_divide#

jax.numpy.floor_divide(x1,x2,/)[source]#

Calculates the floor division of x1 by x2 element-wise

JAX implementation ofnumpy.floor_divide.

Parameters:
  • x1 (ArrayLike) – Input array, the dividend

  • x2 (ArrayLike) – Input array, the divisor

Returns:

An array-like object containing each of the quotients rounded downto the nearest integer towards negative infinity. This is equivalenttox1//x2 in Python.

Return type:

Array

Note

x1//x2 is equivalent tojnp.floor_divide(x1,x2) for arraysx1andx2

See also

jax.numpy.divide() andjax.numpy.true_divide() for floating pointdivision.

Examples

>>>x1=jnp.array([10,20,30])>>>x2=jnp.array([3,4,7])>>>jnp.floor_divide(x1,x2)Array([3, 5, 4], dtype=int32)
>>>x1=jnp.array([-5,-4,-3,-2,-1,0,1,2,3,4,5])>>>x2=3>>>jnp.floor_divide(x1,x2)Array([-2, -2, -1, -1, -1,  0,  0,  0,  1,  1,  1], dtype=int32)
>>>x1=jnp.array([6,6,6],dtype=jnp.int32)>>>x2=jnp.array([2.0,2.5,3.0],dtype=jnp.float32)>>>jnp.floor_divide(x1,x2)Array([3., 2., 2.], dtype=float32)

[8]ページ先頭

©2009-2025 Movatter.jp