copyToFloatArray
Copies all tensor data to a FloatArray.
This method provides efficient bulk data transfer from tensor storage to a FloatArray. Backend implementations (e.g., GPU backends) can override this to provide optimized bulk copy operations instead of element-by-element access.
The default implementation iterates over all elements, which may be slow for backends where individual element access is expensive (e.g., GPU tensors).
Return
a new FloatArray containing all tensor values in row-major order