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

Function TestAdd3DCol

tensor/table/table_test.go:14–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestAdd3DCol(t *testing.T) {
15 dt := NewTable()
16 dt.AddFloat32TensorColumn("Values", []int{11, 1, 16})
17
18 col := dt.ColumnByName("Values")
19 if col.NumDims() != 4 {
20 t.Errorf("Add4DCol: # of dims != 4\n")
21 }
22
23 if col.Shape().DimSize(0) != 1 {
24 t.Errorf("Add4DCol: dim 0 len != 1, was: %v\n", col.Shape().DimSize(0))
25 }
26
27 if col.Shape().DimSize(1) != 11 {
28 t.Errorf("Add4DCol: dim 0 len != 11, was: %v\n", col.Shape().DimSize(1))
29 }
30
31 if col.Shape().DimSize(2) != 1 {
32 t.Errorf("Add4DCol: dim 0 len != 1, was: %v\n", col.Shape().DimSize(2))
33 }
34
35 if col.Shape().DimSize(3) != 16 {
36 t.Errorf("Add4DCol: dim 0 len != 16, was: %v\n", col.Shape().DimSize(3))
37 }
38}
39
40func NewTestTable() *Table {
41 dt := NewTable()

Callers

nothing calls this directly

Calls 7

ColumnByNameMethod · 0.95
NewTableFunction · 0.70
NumDimsMethod · 0.65
ErrorfMethod · 0.65
DimSizeMethod · 0.65
ShapeMethod · 0.65

Tested by

no test coverage detected