A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.lcm.html below:

jax.numpy.lcm — JAX documentation

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

Compute the least common multiple of two arrays.

JAX implementation of numpy.lcm().

Parameters:
  • x1 (ArrayLike) – First input array. The elements must have integer dtype.

  • x2 (ArrayLike) – Second input array. The elements must have integer dtype.

Returns:

An array containing the least common multiple of the corresponding elements from the absolute values of x1 and x2.

Return type:

Array

See also

Examples

Scalar inputs:

>>> jnp.lcm(12, 18)
Array(36, dtype=int32, weak_type=True)

Array inputs:

>>> x1 = jnp.array([12, 18, 24])
>>> x2 = jnp.array([5, 10, 15])
>>> jnp.lcm(x1, x2)
Array([ 60,  90, 120], dtype=int32)

Broadcasting:

>>> x1 = jnp.array([12])
>>> x2 = jnp.array([6, 9, 12])
>>> jnp.lcm(x1, x2)
Array([12, 36, 12], dtype=int32)

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4