(t *testing.T)
| 110 | } |
| 111 | |
| 112 | func TestTensorHandleToTensor(t *testing.T) { |
| 113 | initialVals := [][]float32{{1.0, 2.0}, {3.0, 4.0}} |
| 114 | initialTensor, err := NewTensor(initialVals) |
| 115 | if err != nil { |
| 116 | t.Fatal(err) |
| 117 | } |
| 118 | th, err := NewTensorHandle(initialTensor) |
| 119 | if err != nil { |
| 120 | t.Fatal(err) |
| 121 | } |
| 122 | |
| 123 | tensor, err := th.ToTensor() |
| 124 | if v := tensor.Value().([][]float32); !reflect.DeepEqual(v, initialVals) { |
| 125 | t.Errorf("Got %#v, want %#v", v, initialVals) |
| 126 | } |
| 127 | } |
nothing calls this directly
no test coverage detected