SaveCSV writes a tensor to a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg). Outer-most dims are rows in the file, and inner-most is column -- Reading just grabs all values and doesn't care about shape.
(tsr Tensor, filename core.Filename, delim rune)
| 19 | // Outer-most dims are rows in the file, and inner-most is column -- |
| 20 | // Reading just grabs all values and doesn't care about shape. |
| 21 | func SaveCSV(tsr Tensor, filename core.Filename, delim rune) error { |
| 22 | fp, err := os.Create(string(filename)) |
| 23 | defer fp.Close() |
| 24 | if err != nil { |
| 25 | log.Println(err) |
| 26 | return err |
| 27 | } |
| 28 | WriteCSV(tsr, fp, delim) |
| 29 | return nil |
| 30 | } |
| 31 | |
| 32 | // OpenCSV reads a tensor from a comma-separated-values (CSV) file |
| 33 | // (where comma = any delimiter, specified in the delim arg), |