MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TestListDevices

Function TestListDevices

tensorflow/go/session_test.go:287–301  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

285}
286
287func TestListDevices(t *testing.T) {
288 s, err := NewSession(NewGraph(), nil)
289 if err != nil {
290 t.Fatalf("NewSession(): %v", err)
291 }
292
293 devices, err := s.ListDevices()
294 if err != nil {
295 t.Fatalf("ListDevices(): %v", err)
296 }
297
298 if len(devices) == 0 {
299 t.Fatalf("no devices detected")
300 }
301}
302
303func TestDeviceString(t *testing.T) {
304 d := Device{Name: "foo", Type: "bar", MemoryLimitBytes: 12345}

Callers

nothing calls this directly

Calls 3

ListDevicesMethod · 0.95
NewGraphFunction · 0.85
NewSessionFunction · 0.70

Tested by

no test coverage detected