Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.ref.get

Contents

jax.ref.get#

jax.ref.get(ref,idx=None)[source]#

Read a value from an Ref.

This is equivalent toref[idx] for a NumPy-style indexeridx.For more on mutable array refs, refer to theRef guide.

Parameters:
Returns:

Ajax.Array object (note, not ajax.ref.Ref) containingthe indexed elements of the mutable reference.

Return type:

Array | HijaxType

Examples

>>>importjax>>>ref=jax.new_ref(jax.numpy.arange(5))>>>jax.ref.get(ref,slice(1,3))Array([1, 2], dtype=int32)

Equivalent operation via indexing syntax:

>>>ref[1:3]Array([1, 2], dtype=int32)

Use... to extract the full buffer:

>>>ref[...]Array([0, 1, 2, 3, 4], dtype=int32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp