Transfer buffer data from device to host and return an R array.
Usage
# S3 method for class 'PJRTBuffer'
as_array(x, check = FALSE, ...)Arguments
- x
(
PJRTBuffer)
Buffer to convert.- check
(
logical(1))
IfTRUE, sanity-check the materialized R vector against losing information across the device-to-host boundary, and abort if any problematic value is detected:i32/i64: anyNAin the result. R'sNA_integer_shares the bit patternINT_MIN;bit64'sNA_integer64_sharesINT64_MIN. A legitimate device value at those bit patterns is indistinguishable fromNAonce materialized in R.ui64: any negative value in the result.ui64is stored asbit64::integer64(signed 64-bit), which wraps values>= 2^63to negative — exactly2^63becomesNA_integer64_, anything above becomes a non-NA negative integer64.
No-op for float, boolean, and small/unsigned-32 integer dtypes —
ui32is now stored asinteger64and has full headroom, so it cannot produce a wrapped or NA value.- ...
Additional arguments (unused).
Value
An R array (or vector for shape integer()).