MCPcopy Create free account
hub / github.com/cogentcore/core / SaveCSV

Function SaveCSV

tensor/io.go:21–30  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
21func 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),

Callers

nothing calls this directly

Calls 4

WriteCSVFunction · 0.85
CreateMethod · 0.80
PrintlnMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected