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

Function TestAddGradientsWithDevice

tensorflow/go/op/gradients_test.go:235–246  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

233}
234
235func TestAddGradientsWithDevice(t *testing.T) {
236 var (
237 s = NewScope()
238 x = Placeholder(s.SubScope("x"), tf.Float)
239 y0 = Square(s.SubScope("y0"), x)
240 )
241 s = s.WithDevice("/device:GPU:0")
242 Gradients(s, []tf.Output{y0}, []tf.Output{x})
243 if err := s.Err(); err == nil {
244 t.Error("Gradients should have failed when device is set")
245 }
246}

Callers

nothing calls this directly

Calls 8

NewScopeFunction · 0.85
SubScopeMethod · 0.80
PlaceholderFunction · 0.70
SquareFunction · 0.70
GradientsFunction · 0.70
WithDeviceMethod · 0.45
ErrMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected