(t *testing.T)
| 233 | } |
| 234 | |
| 235 | func 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 | } |
nothing calls this directly
no test coverage detected