OnesLikeΒΆ

Returns a tensor filled with the scalar value 1, with the same size as input.

Abstract Signature:

OnesLike(input: Tensor, dtype: DType = None)

PyTorch

API: torch.ones_like
Strategy: Direct Mapping

JAX (Core)

API: jax.numpy.ones_like
Strategy: Direct Mapping

NumPy

API: numpy.ones_like
Strategy: Direct Mapping

Keras

API: keras.ops.ones_like
Strategy: Direct Mapping

TensorFlow

API: tf.ones_like
Strategy: Direct Mapping

Apple MLX

API: mlx.core.ones_like
Strategy: Direct Mapping

Flax NNX

API: jax.numpy.ones_like
Strategy: Direct Mapping

PaxML / Praxis

API: jax.numpy.ones_like
Strategy: Direct Mapping