loadTensorData

Load tensor data for a specific tensor.

Return

Raw bytes for the tensor

Parameters

tensor

The tensor info from tensors list


fun loadTensorData(tensor: StreamingTensorInfo, buffer: ByteArray, offset: Int = 0): Int(source)

Load tensor data into an existing buffer. Useful for avoiding allocations when processing multiple tensors.

Return

Number of bytes read

Parameters

tensor

The tensor info

buffer

Target buffer (must be at least tensor.nBytes)

offset

Starting offset in buffer