ak.typetracer.length_one_if_typetracer#

Defined in awkward.typetracer on line 112.

ak.typetracer.length_one_if_typetracer(array, *, highlevel=True, behavior=None, attrs=None)#
Parameters:
  • array – Array-like data (anything ak.to_layout recognizes).

  • highlevel (bool) – If True, return an ak.Array; otherwise, return a low-level ak.contents.Content subclass.

  • behavior (None or dict) – Custom ak.behavior for the output array, if high-level.

  • attrs (None or dict) – Custom attributes for the output array, if high-level.

Recursively touches the data of an array, before returning a length-one NumPy-backed iff. the given array has a typetracer backend; otherwise, a shallow copy of the original array is returned.