Skip to contents

Copy a PJRTBuffer to a raw R vector containing the buffer data as bytes. Any shape information is lost.

Usage

as_raw(buffer, client = pjrt_client(), row_major)

Arguments

buffer

(PJRTBuffer)
A PJRT buffer object.

client

(PJRTClient | character(1))
A PJRT client object or the name of the platform to use ("cpu", "cuda", ...), from which the client will be created.

row_major

(logical(1))
Whether to return the data in row-major format (TRUE) or column-major format (FALSE). R uses column-major format.

Value

raw()