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

Function TestDevice

tensorflow/go/op/scope_test.go:115–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

113}
114
115func TestDevice(t *testing.T) {
116 s := NewScope()
117 matrix := Const(s, [][]float32{{3.0}})
118 s = s.WithDevice("/device:GPU:0")
119 square := MatMul(s.SubScope("square"), matrix, matrix)
120 s = s.WithDevice("")
121 cube := MatMul(s.SubScope("cube"), square, matrix)
122 if got, want := square.Op.Device(), "/device:GPU:0"; got != want {
123 t.Errorf("Got %q, want %q", got, want)
124 }
125 if got, want := cube.Op.Device(), ""; got != want {
126 t.Errorf("Got %q, want %q", got, want)
127 }
128}
129
130func TestScopeFinalize(t *testing.T) {
131 var (

Callers

nothing calls this directly

Calls 6

WithDeviceMethod · 0.95
SubScopeMethod · 0.95
NewScopeFunction · 0.85
ConstFunction · 0.70
MatMulFunction · 0.70
DeviceMethod · 0.45

Tested by

no test coverage detected