(t *testing.T)
| 70 | } |
| 71 | |
| 72 | func TestTensorHandleDeviceName(t *testing.T) { |
| 73 | vals := [][]float32{{1.0, 2.0}, {3.0, 4.0}} |
| 74 | tensor, err := NewTensor(vals) |
| 75 | if err != nil { |
| 76 | t.Fatal(err) |
| 77 | } |
| 78 | th, err := NewTensorHandle(tensor) |
| 79 | if err != nil { |
| 80 | t.Fatal(err) |
| 81 | } |
| 82 | |
| 83 | d, err := th.DeviceName() |
| 84 | if err != nil { |
| 85 | t.Fatal(err) |
| 86 | } |
| 87 | if !strings.Contains(d, "CPU") { |
| 88 | t.Errorf("DeviceName() did not return a CPU device; got: %s", d) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func TestTensorHandleBackingDeviceName(t *testing.T) { |
| 93 | vals := [][]float32{{1.0, 2.0}, {3.0, 4.0}} |
nothing calls this directly
no test coverage detected