OpenCSV reads a tensor from a comma-separated-values (CSV) file (where comma = any delimiter, specified in the delim arg), using the Go standard encoding/csv reader conforming to the official CSV standard. Reads all values and assigns as many as fit.
(tsr Tensor, filename core.Filename, delim rune)
| 35 | // to the official CSV standard. |
| 36 | // Reads all values and assigns as many as fit. |
| 37 | func OpenCSV(tsr Tensor, filename core.Filename, delim rune) error { |
| 38 | fp, err := os.Open(string(filename)) |
| 39 | defer fp.Close() |
| 40 | if err != nil { |
| 41 | log.Println(err) |
| 42 | return err |
| 43 | } |
| 44 | return ReadCSV(tsr, fp, delim) |
| 45 | } |
| 46 | |
| 47 | ////////////////////////////////////////////////////////////////////////// |
| 48 | // WriteCSV |