(t *testing.T)
| 90 | } |
| 91 | |
| 92 | func TestTensorHandleBackingDeviceName(t *testing.T) { |
| 93 | vals := [][]float32{{1.0, 2.0}, {3.0, 4.0}} |
| 94 | tensor, err := NewTensor(vals) |
| 95 | if err != nil { |
| 96 | t.Fatal(err) |
| 97 | } |
| 98 | th, err := NewTensorHandle(tensor) |
| 99 | if err != nil { |
| 100 | t.Fatal(err) |
| 101 | } |
| 102 | |
| 103 | d, err := th.BackingDeviceName() |
| 104 | if err != nil { |
| 105 | t.Fatal(err) |
| 106 | } |
| 107 | if !strings.Contains(d, "CPU") { |
| 108 | t.Errorf("BackingDeviceName() did not return a CPU device; got: %s", d) |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func TestTensorHandleToTensor(t *testing.T) { |
| 113 | initialVals := [][]float32{{1.0, 2.0}, {3.0, 4.0}} |
nothing calls this directly
no test coverage detected