ak.to_torch#

Defined in awkward.operations.ak_to_torch on line 15.

ak.to_torch(array)#
Parameters:

array – Array-like data. May be a high level ak.Array, or low-level ak.contents.ListOffsetArray, ak.contents.ListArray, ak.contents.RegularArray, ak.contents.NumpyArray

Converts array (only ListOffsetArray, ListArray, RegularArray and NumpyArray data types supported) into a PyTorch Tensor, if possible.

If array contains any other data types (RecordArray for example) the function raises a TypeError.