Reading Tensor From File

Is anyone aware how the Tensor.fromfile() function works as explained in the mojo docs? I've tried reading from txt and csv files as well as files generated by the Tensor.tofile() function but none of these seem to create a Tensor with any desired values.
No description
4 Replies
benny
benny5w ago
I would assume it’s just writing a header with the metadata then just raw binary for the data, I think we did similar somewhere in <#1238547362012729355> , you won’t be able to read them without custom tools (or obviously tensor.from file)
carlcaulkett
carlcaulkett5w ago
Do you need to use a Tensor at all? I had some code that used Tensors, until I found that I could just use the FileHandle.read_bytes function. Here's my code...
carlcaulkett
carlcaulkett5w ago
No description
carlcaulkett
carlcaulkett5w ago
Here's the code for converting from the raw data of List[UInt8]s to Strings...
No description
Want results from more Discord servers?
Add your server